Learn R Programming

latrend (version 1.6.1)

responseVariable: Extract response variable

Description

Extracts the response variable from the given object.

Get the response variable, i.e., the dependent variable.

Usage

responseVariable(object, ...)

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

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

Value

A nonempty string, as character.

Arguments

object

The object.

...

Not used.

Details

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

See Also

Other variables: idVariable(), timeVariable()

Examples

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

Run the code above in your browser using DataLab