Learn R Programming

finalfit (version 0.8.9)

glmmixed: Mixed effects binomial logistic regression models: finalfit model wrapper

Description

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

Usage

glmmixed(.data, dependent, explanatory, random_effect)

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.

random_effect

Character vector of length 1, name of random effect variable.

Value

A list of multivariable lme4::glmer fitted model outputs. Output is of class glmerMod.

Details

Uses lme4::glmer with finalfit modelling conventions. Output can be passed to fit2df. This is only currently set-up to take a single random effect as a random intercept. Can be updated in future to allow multiple random intercepts, random gradients and interactions on random effects if there is a need

See Also

fit2df, finalfit_merge

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

Examples

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

explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
random_effect = "hospital"
dependent = "mort_5yr"

colon_s %>%
  glmmixed(dependent, explanatory, random_effect) %>%
	 fit2df(estimate_suffix=" (multilevel")
# }

Run the code above in your browser using DataLab