Learn R Programming

finalfit (version 1.0.8)

lmmulti: Linear regression multivariable models: finalfit model wrapper

Description

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

Usage

lmmulti(.data, dependent, explanatory, weights = "", ...)

Value

A multivariable lm fitted model.

Arguments

.data

Dataframe.

dependent

Character vector of length 1: name of depdendent variable (must a continuous vector).

explanatory

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

weights

Character vector of length 1: name of variabe for weighting. 'Prior weights' to be used in the fitting process.

...

Other arguments to pass to lm.

Details

Uses lm with finalfit modelling conventions. Output can be passed to fit2df.

See Also

fit2df

Other finalfit model wrappers: coxphmulti(), coxphuni(), crrmulti(), crruni(), glmmixed(), glmmulti_boot(), glmmulti(), glmuni(), lmmixed(), lmuni(), svyglmmulti(), svyglmuni()

Examples

Run this code
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