Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

standardize

Estimate standardized regression coefficients for all variables


Description

This is brain-dead standardization of all variables in the design matrix. It mimics the silly output of SPSS, which standardizes all regressors, even if they represent categorical variables.

Usage

standardize(model)

## S3 method for class 'lm'
standardize(model)

Arguments

model

a fitted lm object

Value

an lm fitted with the standardized variables

a standardized regression object

Author(s)

Paul Johnson <pauljohn@ku.edu>

See Also

meanCenter which will center or re-scale only numberic variables

Examples

library(rockchalk)
N <- 100
dat <- genCorrelatedData(N = N, means = c(100,200), sds = c(20,30), rho = 0.4, stde = 10)
dat$x3 <- rnorm(100, m = 40, s = 4)

m1 <- lm(y ~ x1 + x2 + x3, data = dat)
summary(m1)

m1s <- standardize(m1)
summary(m1s)



m2 <- lm(y ~ x1 * x2 + x3, data = dat)
summary(m2)

m2s <- standardize(m2)
summary(m2s)

m2c <- meanCenter(m2)
summary(m2c)

rockchalk

Regression Estimation and Presentation

v1.8.144
GPL (>= 3.0)
Authors
Paul E. Johnson [aut, cre], Gabor Grothendieck [ctb]
Initial release
2019-03-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.