Learn R Programming

sjmisc (version 1.2)

std_beta: Standardized Beta coefficients and CI of lm and mixed models

Description

Returns the standardized beta coefficients and confidence intervals of a fitted linear (mixed) models, i.e. fit must either be of class lm or merMod.

Usage

std_beta(fit, include.ci = FALSE, type = "std")

Arguments

fit
Fitted linear (mixed) model of class lm or merMod (lme4 package).
include.ci
Logical, if TRUE, a data frame with confidence intervals will be returned, when fit is of class lm. If fit is a lmerMod object (lme4 package), always returns standard error ins
type
If fit is of class lm, normal standardized coefficients are computed by default. Use type = "std2" to follow http://www.stat.columbia.edu/~gelman/research/published/standardizing7.pdf{Gelman's (2008)}

Value

  • A vector with standardized beta coefficients of the fitted linear model, or a data frame with standardized beta coefficients and confidence intervals, if include.ci = TRUE.

References

  • http://en.wikipedia.org/wiki/Standardized_coefficient{Wikipedia: Standardized coefficient}
  • Gelman A (2008) "Scaling regression inputs by dividing by two standard deviations."Statistics in Medicine 27: 2865–2873.http://www.stat.columbia.edu/~gelman/research/published/standardizing7.pdf

Examples

Run this code
# fit linear model
fit <- lm(Ozone ~ Wind + Temp + Solar.R, data = airquality)
# print std. beta coefficients
std_beta(fit)

# print std. beta coefficients and ci
std_beta(fit, include.ci = TRUE)

# print std. beta coefficients and ci, using
# 2 sd and center binary predictors
std_beta(fit, include.ci = TRUE, type = "std2")

Run the code above in your browser using DataLab