clusterTrajectories: Extract the cluster trajectories

clusterTrajectoriesR Documentation

Extract the cluster trajectories

Description

Extracts a data frame of all cluster trajectories.

Usage

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

Arguments

object

The lcModel object.

at

An optional vector of the times at which to compute the cluster trajectory predictions.

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. The first column should be named "Cluster". The second column should be time, with the name matching the timeVariable(object). The third column should be the expected value of the observations, named after the responseVariable(object).

See Also

Other lcModel functions: clusterNames(), clusterProportions(), clusterSizes(), coef.lcModel(), converged(), deviance.lcModel(), df.residual.lcModel(), estimationTime(), externalMetric,lcModel,lcModel-method, fitted.lcModel(), fittedTrajectories(), getCall.lcModel(), getLcMethod(), ids(), lcModel-class, metric(), model.frame.lcModel(), nClusters(), nIds(), nobs.lcModel(), plot-lcModel-method, plotClusterTrajectories(), plotFittedTrajectories(), postprob(), predict.lcModel(), predictAssignments(), predictForCluster(), predictPostprob(), qqPlot(), residuals.lcModel(), sigma.lcModel(), strip(), time.lcModel(), trajectoryAssignments()

Examples

method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)

clusterTrajectories(model)

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

latrend documentation built on March 31, 2023, 5:45 p.m.