Learn R Programming

sjPlot (version 2.0.0)

sjt.glmer: Summary of generalized linear mixed models as HTML table

Description

Summarizes (multiple) fitted generalized linear mixed models (odds ratios, ci, p-values...) as HTML table, or saves them as file. The fitted models may have different predictors, e.g. when comparing different stepwise fitted models.

Usage

sjt.glmer(..., pred.labels = NULL, depvar.labels = NULL,
  remove.estimates = NULL, group.pred = FALSE, exp.coef = TRUE,
  p.numeric = TRUE, emph.p = TRUE, separate.ci.col = TRUE,
  newline.ci = TRUE, show.ci = TRUE, show.se = FALSE,
  show.header = FALSE, show.col.header = TRUE, show.r2 = FALSE,
  show.icc = TRUE, show.re.var = TRUE, show.loglik = FALSE,
  show.aic = FALSE, show.aicc = FALSE, show.dev = TRUE,
  show.hoslem = FALSE, show.family = FALSE, string.pred = "Predictors",
  string.dv = "Dependent Variables", string.interc = "(Intercept)",
  string.obs = "Observations", string.est = "OR", string.ci = "CI",
  string.se = "std. Error", string.p = "p",
  ci.hyphen = " – ", digits.est = 2, digits.p = 3,
  digits.ci = 2, digits.se = 2, digits.summary = 3, cell.spacing = 0.2,
  cell.gpr.indent = 0.6, CSS = NULL, encoding = NULL, file = NULL,
  use.viewer = TRUE, no.output = FALSE, remove.spaces = TRUE)

Arguments

Value

Invisibly returns
  • the web page style sheet (page.style),
  • the web page content (page.content),
  • the complete html-output (output.complete) and
  • the html-table with inline-css for use with knitr (knitr)
for further use.

Details

See 'Details' in sjt.frq.

Examples

Run this code
library(lme4)
library(sjmisc)
data(efc)

# create binary response
efc$hi_qol <- dicho(efc$quol_5)
# prepare group variable
efc$grp = as.factor(efc$e15relat)
levels(x = efc$grp) <- get_labels(efc$e15relat)
# data frame for fitted model
mydf <- data.frame(hi_qol = to_factor(efc$hi_qol),
                   sex = to_factor(efc$c161sex),
                   c12hour = efc$c12hour,
                   neg_c_7 = efc$neg_c_7,
                   education = to_factor(efc$c172code),
                   grp = efc$grp)
                   
# fit glmer
fit1 <- glmer(hi_qol ~ sex + c12hour + neg_c_7 + (1|grp),
              data = mydf, family = binomial("logit"))
fit2 <- glmer(hi_qol ~ sex + c12hour + neg_c_7 + education + (1|grp),
              data = mydf, family = binomial("logit"))
              
# print summary table
sjt.glmer(fit1, fit2, ci.hyphen = " to ")

# print summary table, using different table layout
sjt.glmer(fit1, fit2, show.aic = TRUE, show.ci = FALSE,
          show.se = TRUE, p.numeric = FALSE)
          
# print summary table
sjt.glmer(fit1, fit2, pred.labels = c("Elder's gender (female)",
            "Hours of care per week", "Negative Impact",
            "Educational level (mid)", "Educational level (high)"))

# use vector names as predictor labels
sjt.glmer(fit1, fit2, pred.labels = "")

Run the code above in your browser using DataLab