Learn R Programming

sjPlot (version 1.8.1)

sjt.lmer: Show linear mixed effects models as HTML table

Description

Summarizes (multiple) fitted linear mixed effects models (beta coefficients, std. beta values etc.) 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.lmer(..., file = NULL, labelPredictors = NULL,
  labelDependentVariables = NULL, stringPredictors = "Predictors",
  stringDependentVariables = "Dependent Variables", stringModel = "Model",
  showHeaderStrings = FALSE, stringIntercept = "(Intercept)",
  stringObservations = "Observations", stringB = "B",
  stringSB = "std. Beta", stringCI = "CI", stringSE = "std. Error",
  stringP = "p", showEst = TRUE, showConfInt = TRUE,
  showStdBeta = FALSE, showStdError = FALSE, digits.est = 2,
  digits.p = 3, digits.ci = 2, digits.se = 2, digits.sb = 2,
  digits.summary = 3, pvaluesAsNumbers = TRUE, boldpvalues = TRUE,
  separateConfColumn = TRUE, newLineConf = TRUE, showAbbrHeadline = TRUE,
  showICC = TRUE, showAIC = 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.

See Also

http://strengejacke.de/sjPlot/sjt.lmer/{sjPlot manual: sjt.lmer} and sjt.lm for further examples.

Examples

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

# prepare group variable
efc$grp = as.factor(efc$e15relat)
levels(x = efc$grp) <- get_val_labels(efc$e15relat)
efc$care.level <- as.factor(sjmisc::rec(efc$n4pstu, "0=0;1=1;2=2;3:4=4"))
levels(x = efc$care.level) <- c("none", "I", "II", "III")

# data frame for fitted model
mydf <- data.frame(neg_c_7 = as.numeric(efc$neg_c_7),
                   sex = as.factor(efc$c161sex),
                   c12hour = as.numeric(efc$c12hour),
                   barthel = as.numeric(efc$barthtot),
                   education = as.factor(efc$c172code),
                   grp = efc$grp,
                   carelevel = efc$care.level)

# fit two sample models
fit1 <- lmer(neg_c_7 ~ sex + c12hour + barthel + (1|grp), data = mydf)
fit2 <- lmer(neg_c_7 ~ sex + c12hour + education + barthel + (1|grp), data = mydf)
fit3 <- lmer(neg_c_7 ~ sex + c12hour + education + barthel +
              (1|grp) +
              (1|carelevel), data = mydf)

# print summary table
sjt.lmer(fit1, fit2)

sjt.lmer(fit1, fit2,
         showAIC = TRUE,
         showConfInt = FALSE,
         showStdError = TRUE,
         pvaluesAsNumbers = FALSE)

sjt.lmer(fit1, fit2, fit3,
         showAIC = TRUE,
         separateConfColumn = FALSE,
         newLineConf = FALSE)

Run the code above in your browser using DataLab