Learn R Programming

latrend (version 1.2.1)

fittedTrajectories: Extract the fitted trajectories for all strata

Description

Extract the fitted trajectories for all strata

Usage

# S4 method for 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.

Value

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

Details

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

See Also

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

Examples

Run this code
# NOT RUN {
data(latrendData)
m <- lcMethodKML("Y", id = "Id", time = "Time")
model <- latrend(method = m, data = latrendData)
fittedTrajectories(model)

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

Run the code above in your browser using DataLab