fittedTrajectories: Extract the fitted trajectories for all strata

fittedTrajectoriesR Documentation

Extract the fitted trajectories for all strata

Description

Extract the fitted trajectories for all strata

Usage

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

Arguments

object

The model.

at

The time points at which to compute the id-specific trajectories. The default implementation merely filters the output of fitted(), so fitted values can only be outputted for times at which the model was trained.

what

The distributional parameter to compute the response for.

clusters

The cluster assignments for the strata to base the trajectories on.

...

Additional arguments.

Details

The default implementation uses the output of fitted() of the respective model.

Value

A data.frame representing the fitted response per trajectory per moment in time for the respective cluster.

See Also

Other lcModel functions: clusterNames(), clusterProportions(), clusterSizes(), clusterTrajectories(), coef.lcModel(), converged(), deviance.lcModel(), df.residual.lcModel(), estimationTime(), externalMetric,lcModel,lcModel-method, fitted.lcModel(), 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

data(latrendData)
# Note: not a great example because the fitted trajectories
# are identical to the respective cluster trajectory
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)
fittedTrajectories(model)

fittedTrajectories(model, at = time(model)[c(1, 2)])

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