Learn R Programming

latrend (version 1.3.0)

coef.lcModel: Extract lcModel coefficients

Description

Extract the coefficients of the lcModel object, if defined. The returned set of coefficients depends on the underlying type of lcModel. The default implementation checks for the existence of a coef() function for the internal model as defined in the @model slot, returning the output if available.

Usage

# S3 method for lcModel
coef(object, ...)

Arguments

object

The lcModel object.

...

Additional arguments.

Value

A named numeric vector with all coefficients, or a matrix with each column containing the cluster-specific coefficients. If coef() is not defined for the given model, an empty numeric vector is returned.

Implementation

Classes extending lcModel can override this method to return model-specific coefficients.

coef.lcModelExt <- function(object, ...) {
  # return model coefficients
}

See Also

Other model-specific methods: clusterTrajectories(), converged(), deviance.lcModel(), df.residual.lcModel(), fitted.lcModel(), fittedTrajectories(), 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)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData, nClusters = 2)
coef(model)
# }

Run the code above in your browser using DataLab