Learn R Programming

latrend (version 1.3.0)

responseVariable: Extract the response variable

Description

Extracts the response variable from the given object.

Usage

# S4 method for lcMethod
responseVariable(object, ...)

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

Arguments

object

The object to extract the response variable from.

...

Additional arguments.

Value

The response variable name as a character.

Details

If the lcMethod object specifies a formula argument, then the response is extracted from the response term of the formula.

See Also

Other lcModel variables: idVariable(), timeVariable()

Examples

Run this code
# NOT RUN {
method <- lcMethodLMKM(Y ~ Time)
responseVariable(method) # "Y"
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)
responseVariable(model) # "Y"
# }

Run the code above in your browser using DataLab