50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


asympDiag (version 0.3.1)

get_model_response: 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)

Value

The response variable extracted from the model. If it couldn't be extracted, the function returns NULL.

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.

Examples

Run this code
lm_model <- lm(mpg ~ wt + cyl, data = mtcars)
response <- get_model_response(lm_model)
print(response)

Run the code above in your browser using DataLab