Learn R Programming

latrend (version 1.0.1)

clusterTrajectories: Extract the cluster trajectories

Description

Extracts a data frame of all cluster trajectories.

Usage

# S4 method for lcModel
clusterTrajectories(object, at = time(object), what = "mu", ...)

Arguments

object

The lcModel object.

at

An optional vector, list or data frame of covariates at which to compute the cluster trajectory predictions. If a vector is specified, this is assumed to be the time covariate. Otherwise, a named list or data frame must be provided.

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'.

...

Additional arguments.

Value

A data.frame of the estimated values at the given times

See Also

Other model-specific methods: coef.lcModel(), converged(), deviance.lcModel(), df.residual.lcModel(), fitted.lcModel(), lcModel-class, logLik.lcModel(), model.frame.lcModel(), nobs.lcModel(), postprob(), predict.lcModel(), predictAssignments(), predictForCluster(), predictPostprob(), residuals.lcModel(), sigma.lcModel(), time.lcModel(), trajectories()

Examples

Run this code
# NOT RUN {
model <- latrend(method = lcMethodLcmmGMM(Y ~ Time + (1 | Id)),
  id = "Id", time = "Time", data = latrendData)
clusterTrajectories(model)

clusterTrajectories(model, at = c(0, .5, 1))
# }

Run the code above in your browser using DataLab