I am new to RStudio and have a problem when loading the package 'lcmm' from my data.
This is the following code I am using:
'
library(lcmm)
dat = baseline4_0
lcmm11 <- lcmm(K1 ~ poly(year, degree = 1, raw = TRUE), random =~ year,
subject = 'nsin', data = dat, ng = 1, link = 'linear')
'
No matter what I do, I keep getting the error:
Error in [.data.frame(newdata, , nom.subject) :
undefined columns selected
We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.