get_model_response {asympDiag} | R Documentation |
Extract the Response Variable from a Model Object
Description
This function is designed to extract the response variable from a fitted model object.
Usage
get_model_response(object)
Arguments
object |
A fitted model from which the response variable should be extracted. |
Details
The default method attempts to create a model frame using model.frame()
.
Any error encountered during this process is caught and
results in a NULL
return value.
Value
The response variable extracted from the model. If it couldn't be extracted,
the function returns NULL
.
Examples
lm_model <- lm(mpg ~ wt + cyl, data = mtcars)
response <- get_model_response(lm_model)
print(response)
[Package asympDiag version 0.3.1 Index]