Learn R Programming

latrend (version 1.2.1)

formula.lcModel: Extract the formula of a lcModel

Description

Get the formula associated with the fitted lcModel object. This is determined by the formula argument of the lcMethod specification that was used to fit the model.

Usage

# S3 method for lcModel
formula(x, what = "mu", ...)

Arguments

x

The lcModel object.

what

The distributional parameter.

...

Additional arguments.

Value

Returns the associated formula, or response ~ 0 if not specified.

See Also

stats::formula

Examples

Run this code
# NOT RUN {
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time", nClusters = 3)
lmkm <- latrend(method, data = latrendData)
formula(lmkm) # Y ~ Time

kml <- latrend(lcMethodKML("Y", id = "Id", time = "Time"), latrendData)
formula(kml) # Y ~ 0
# }

Run the code above in your browser using DataLab