glmmulti: Binomial logistic regression multivariable models: 'finalfit'...

View source: R/glmmulti.R

glmmultiR Documentation

Binomial logistic regression multivariable models: finalfit model wrapper

Description

Using finalfit conventions, produces a multivariable binomial logistic regression model for a set of explanatory variables against a binary dependent.

Usage

glmmulti(.data, dependent, explanatory, family = "binomial", weights = "", ...)

Arguments

.data

Data frame.

dependent

Character vector of length 1: name of dependent variable (must have 2 levels).

explanatory

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

family

Character vector quoted or unquoted of the error distribution and link function to be used in the model, see glm.

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 glm.

Details

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

Value

A multivariable glm fitted model.

See Also

fit2df, finalfit_merge

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

Examples

library(finalfit)
library(dplyr)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "mort_5yr"

colon_s %>%
	glmmulti(dependent, explanatory) %>%
	fit2df(estimate_suffix=" (multivariable)")


finalfit documentation built on Sept. 11, 2024, 9:01 p.m.