predictRE | R Documentation |
The function computes the predicted values of the random effects given observed data provided in input. With multiple latent classes, these predictions are averaged over classes using the posterior class-membership probabilities.
predictRE(model, newdata, subject = NULL)
model |
an object inheriting from class |
newdata |
data frame containing the data from which predictions are to be computed. The data frame should include at least all the covariates listed in model$Xnames2, the marker(s) values and the grouping structure. Names should match exactly the names of the variables in the model. |
subject |
character specifying the name of the grouping structure. If NULL (the default), the same as in the model will be used. |
a matrix containing the grouping structure and the predicted random-effects.
Sasha Cuau, Viviane Philipps, Cecile Proust-Lima
## Not run:
library(NormPsy)
paquid$normMMSE <- normMMSE(paquid$MMSE)
paquid$age65 <- (paquid$age - 65)/10
m2b <- hlme(normMMSE ~ age65+I(age65^2)+CEP, random =~ age65+I(age65^2), subject = 'ID',
data = paquid, ng = 2, mixture =~ age65+I(age65^2), B = c(0, 60, 40, 0, -4, 0, -10, 10,
212.869397, -216.421323,456.229910, 55.713775, -145.715516, 59.351000, 10.072221))
predictRE(m2b,newdata=paquid[1:6,])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.