Learn R Programming

latrend (version 1.1.0)

lcModelPartition: Create a lcModel with pre-defined partitioning

Description

Represents an arbitrary partitioning of a set of trajectories. As such, this model has no predictive capabilities. The cluster trajectories are represented by the specified center function (mean by default).

Usage

lcModelPartition(
  data,
  response,
  trajectoryAssignments,
  nClusters = NA,
  center = meanNA,
  clusterNames = NULL,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  name = "part",
  envir = parent.frame()
)

Arguments

data

A data.frame representing the trajectory data.

response

The name of the response variable.

trajectoryAssignments

A vector of cluster membership per trajectory, either factor, or integer (1 to nClusters).

nClusters

The number of clusters. Optional for factor assignments.

center

The function for computing the longitudinal cluster centers, used for representing the cluster trajectories.

clusterNames

The names of the clusters, or a function with input n outputting a character vector of names.

time

The name of the time variable.

id

The name of the trajectory identification variable.

name

The name of the method.

envir

The environment associated with the model. Used for evaluating the assigned data object by model.data.lcModel.