Learn R Programming

latrend (version 1.1.0)

plotTrajectories: Plot trajectories

Description

Plot trajectories

Plot fitted trajectories of a lcModel

Usage

# S4 method for data.frame
plotTrajectories(
  object,
  response,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  cluster = NULL,
  facet = TRUE,
  ...
)

# S4 method for lcModel plotTrajectories(object, ...)

Arguments

object

The model.

response

Response variable character name or a call.

time

The name of the time variable.

id

The name of the trajectory identifier variable.

cluster

Cluster variable name. If unspecified, trajectories are not grouped. Alternatively, cluster is a vector indicating cluster membership per id.

facet

Whether to facet by cluster.

...

Arguments passed on to trajectories

at

The time points at which to compute the id-specific trajectories.

what

The distributional parameter to compute the response for.

clusters

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

Examples

Run this code
# NOT RUN {
data(latrendData)
plotTrajectories(latrendData, response = "Y", id = "Id", time = "Time")

plotTrajectories(latrendData, response = quote(exp(Y)), id = "Id", time = "Time")
# }

Run the code above in your browser using DataLab