Skip to contents

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

Usage

createFromGlm(glmObj, outcome_name = NULL)

Arguments

glmObj

a glm 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 ftmglm object.

Examples

if (FALSE) { # \dontrun{
# Fitting a glm to the mtcars dataset
data(mtcars)
glm_model <- glm(am ~ hp + wt + cyl, data = mtcars, family = "binomial")
ftmglm_model <- createFromGlm(glm_model)
} # }