lcModel predictions
Predicts the expected trajectory observations at the given time for each cluster.
## S3 method for class 'lcModel' predict(object, newdata = NULL, what = "mu", ...)
object |
The |
newdata |
Optional |
what |
The distributional parameter to predict. By default, the mean response 'mu' is predicted. The cluster membership predictions can be obtained by specifying |
... |
Additional arguments. |
Subclasses of lcModel should preferably implement predictForCluster instead of overriding predict.lcModel in order to benefit from standardized error checking and output handling.
If newdata specifies the cluster membership; a data.frame of cluster-specific predictions. Otherwise, a list of data.frame of cluster-specific predictions is returned.
Other model-specific methods:
clusterTrajectories(),
coef.lcModel(),
converged(),
deviance.lcModel(),
df.residual.lcModel(),
fitted.lcModel(),
lcModel-class,
logLik.lcModel(),
model.frame.lcModel(),
nobs.lcModel(),
postprob(),
predictAssignments(),
predictForCluster(),
predictPostprob(),
residuals.lcModel(),
sigma.lcModel(),
time.lcModel(),
trajectories()
data(latrendData) model <- latrend(lcMethodLcmmGMM( fixed = Y ~ Time, mixture = ~ Time, id = "Id", time = "Time"), latrendData) predFitted <- predict(model) # same result as fitted(model) # Cluster trajectory of cluster A predCluster <- predict(model, newdata = data.frame(Cluster = "A", Time = time(model))) # Prediction for id S1 given cluster A membership predId <- predict(model, newdata = data.frame(Cluster = "A", Id = "S1", Time = time(model))) # Prediction matrix for id S1 for all clusters predIdAll <- predict(model, newdata = data.frame(Id = "S1", Time = time(model)))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.