Open shendong333 opened 9 months ago
Hi,
this is a bug in the package. The variable "i" appearing in poly is seen as a covariate, so the error occurs because there is no such variable in data_hlme. I will try to fix it, but a workaround is to create this artificial covariate :
ls <- list() for (i in 1:5) { data_hlme$i <- i model_1 <- hlme(Y ~ poly(Time, degree = i, raw = TRUE), ng = 1, random = ~ -1, data = data_hlme, subject = "ID")
ls[[i]] <- model_1 }
This returns a lot of warnings, but the models seem correct.
Thank you for your feedback.
Viviane
Dear Authors,
I am trying to explore some models based on different polynomial, but in the For-loop I encountered a error I can not fixed on my own. below is what i was tring :
And the error is:
Error in
[.data.frame(data, , v) : undefined columns selected
Many thanks for any help.