Learn R Programming

finalfit (version 0.8.9)

lmmulti: Linear regression multivariable models: finalfit model wrapper

Description

Using finalfit conventions, produces multiple multivariable linear regression models for a set of explanatory variables against a continuous dependent.

Usage

lmmulti(.data, dependent, explanatory)

Arguments

.data

Dataframe.

dependent

Character vector usually of length 1, but can take more than 1 dependent: name of depdendent variable (must a continuous vector).

explanatory

Character vector of any length: name(s) of explanatory variables.

Value

A list of multivariable lm fitted model outputs. Output is of class lmlist.

Details

Uses lm with finalfit modelling conventions. Output can be passed to fit2df. Note that this function can take multiple dependent variables as well, but performs multiple individual models, not a multivariate analysis.

See Also

fit2df

Other finalfit model wrappers: coxphmulti, coxphuni, glmmixed, glmmulti_boot, glmmulti, glmuni, lmmixed, lmuni

Examples

Run this code
# NOT RUN {
library(finalfit)
library(dplyr)

explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "nodes"

colon_s %>%
  lmmulti(dependent, explanatory) %>%
  fit2df()

# }

Run the code above in your browser using DataLab