Learn R Programming

sjPlot (version 1.8.1)

sjt.glmer: Show (and compare) 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(..., file = NULL, labelPredictors = NULL,
  labelDependentVariables = NULL, stringPredictors = "Predictors",
  stringDependentVariables = "Dependent Variables",
  showHeaderStrings = FALSE, stringModel = "Model",
  stringIntercept = "(Intercept)", stringObservations = "Observations",
  stringOR = "OR", stringCI = "CI", stringSE = "std. Error",
  stringP = "p", digits.est = 2, digits.p = 3, digits.ci = 2,
  digits.se = 2, digits.summary = 3, exp.coef = TRUE,
  pvaluesAsNumbers = TRUE, boldpvalues = TRUE, showConfInt = TRUE,
  showStdError = FALSE, separateConfColumn = TRUE, newLineConf = TRUE,
  showAbbrHeadline = TRUE, showICC = TRUE, showLogLik = FALSE,
  showAIC = FALSE, showHosLem = FALSE, showFamily = FALSE,
  remove.estimates = NULL, cellSpacing = 0.2, encoding = NULL,
  CSS = NULL, useViewer = 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_val_labels(efc$e15relat)
# data frame for fitted model
mydf <- data.frame(hi_qol = as.factor(efc$hi_qol),
                   sex = as.factor(efc$c161sex),
                   c12hour = as.numeric(efc$c12hour),
                   neg_c_7 = as.numeric(efc$neg_c_7),
                   education = as.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)
sjt.glmer(fit1, fit2,
          showAIC = TRUE,
          showConfInt = FALSE,
          showStdError = TRUE,
          pvaluesAsNumbers = FALSE)

Run the code above in your browser using DataLab