Learn R Programming

finalfit (version 0.8.9)

glmuni: Binomial logistic regression univariable models: finalfit model wrapper

Description

Using finalfit conventions, produces multiple univariable binomial logistic regression models for a set of explanatory variables against a binary dependent.

Usage

glmuni(.data, dependent, explanatory)

Arguments

.data

Dataframe.

dependent

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

explanatory

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

Value

A list of univariable glm fitted model outputs. Output is of class glmlist.

Details

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

See Also

fit2df, finalfit_merge

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

Examples

Run this code
# NOT RUN {
library(finalfit)
library(dplyr)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "mort_5yr"

colon_s %>%
	glmuni(dependent, explanatory) %>%
	fit2df(estimate_suffix=" (univariable)")


# }

Run the code above in your browser using DataLab