Learn R Programming

latrend (version 1.1.0)

predictForCluster: lcModel prediction for a specific cluster

Description

Predicts the expected trajectory observations at the given time under the assumption that the trajectory belongs to the specified cluster.

Usage

# S4 method for lcModel
predictForCluster(object, newdata = NULL, cluster, ..., what = "mu")

Arguments

object

The lcModel object.

newdata

Optional data.frame for which to compute the model predictions. If omitted, the model training data is used. Cluster trajectory predictions are made when ids are not specified.

cluster

The cluster name (as character) to predict for.

...

Additional arguments.

what

The distributional parameter to predict. By default, the mean response 'mu' is predicted. The cluster membership predictions can be obtained by specifying what = 'mb'.

Value

A vector with the predictions per newdata observation, or a data.frame with the predictions and newdata alongside.

See Also

predict.lcModel

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(), predict.lcModel(), predictAssignments(), predictPostprob(), residuals.lcModel(), sigma.lcModel(), time.lcModel(), trajectories()