Learn R Programming

latrend (version 1.1.0)

lcModelCustom: Specify a model based on a pre-computed result.

Description

Specify a model based on a pre-computed result.

Usage

lcModelCustom(
  data,
  response,
  trajectoryAssignments = NULL,
  clusterTrajectories = mean,
  trajectories = data,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  clusterNames = NULL,
  converged = TRUE,
  postprob = NULL,
  model = NULL,
  name = "custom",
  predict = NULL,
  predictPostprob = NULL,
  method = new("lcMethod")
)

Arguments

data

The data on which the cluster result is based, a data.frame.

response

The response variable.

trajectoryAssignments

A vector indicating cluster membership per strata. Either a numeric vector with range 1:numClus, or a factor.

clusterTrajectories

The cluster trajectories as a data.frame, or a function computing the center trajectory based on the strata of the respective cluster.

trajectories

The fitted trajectories.

time

The time variable.

id

The id variable.

clusterNames

The names of the clusters. Optional.

converged

Convergence state of the model. TRUE by default.

postprob

Optional posterior probability matrix.

model

An optional object representing the internal model.

name

The name of the model.

predict

Predict function for the response.

predictPostprob

Predict function for the posterior probability.

method

The method used to create this lcModelCustom instance. Optional.