Skip to contents

This function extracts necessary components from a lm object to create an ftmlm object. It extracts the necessary components and adapts them into the FTM framework.

Usage

createFromLm(lmObj, outcome_name = NULL)

Arguments

lmObj

a lm object from the stats package

outcome_name

Optional name of the outcome variable; if not provided, it will be extracted from the model object.

Value

A ftmlm object.

Examples

if (FALSE) { # \dontrun{
# Fitting a linear model to the mtcars dataset
data(mtcars)
lm_model <- lm(mpg ~ cyl + hp + wt, data = mtcars)
ftmlm_model <- createFromLm(lm_model)
} # }