data(DT_legendre)
DT <- DT_legendre
head(DT)
# \donttest{
library(orthopolynom)
Z <- with(DT, smm(leg(X,1)) )
## diagonal random regression
form <- paste0( "Y ~ Xf + (0+", paste(colnames(Z), collapse = "+"), "|| SUBJECT)")
## unstructured random regression
form <- paste0( "Y ~ Xf + (0+", paste(colnames(Z), collapse = "+"), "| SUBJECT)")
for(i in 1:ncol(Z)){DT[,colnames(Z)[i]] <- Z[,i]}
mRR2b<-lmebreed(as.formula(form),
, data=DT)
vc <- VarCorr(mRR2b); print(vc,comp=c("Variance"))
# }
Run the code above in your browser using DataLab