Skip to contents

Computes standardized ("beta") regression coefficients for a fitted lm or mlm object, i.e. the coefficients that would result from fitting the same model with all numeric variables rescaled to mean 0, SD 1.

For an "mlm" object, standardization follows stdmodel()'s convention: the response(s) and numeric predictors are standardized; factor predictors are left raw.

Usage

stdcoef(object, ...)

# S3 method for class 'lm'
stdcoef(object, ...)

# S3 method for class 'mlm'
stdcoef(object, ...)

Arguments

object

A fitted "lm" or "mlm" object

...

Additional arguments. Not used.

Value

For an "lm" object, a named numeric vector of standardized coefficients (intercept excluded). For an "mlm" object, a numeric matrix of standardized coefficients (parameters x responses, intercept row excluded).

See also

stdmodel(), coefplot.mlm(). For standard errors, test statistics and p-values on the standardized scale, run lmtest::coeftest() (and, for a tidy data frame, broom::tidy.coeftest()) on stdmodel()'s result.

Other multivariate linear models: coefplot(), glance.mlm(), stdmodel()

Author

Michael Friendly

Examples

data(Prestige, package = "carData")
prestige.mod <- lm(prestige ~ income + education, data = Prestige)
stdcoef(prestige.mod)
#>    income education 
#> 0.3359243 0.6561537 

rohwer.mod <- lm(cbind(SAT, PPVT, Raven) ~ SES + n + s + ns + na + ss, data = Rohwer)
stdcoef(rohwer.mod)
#>               SAT          PPVT        Raven
#> SES1  0.147027414  0.5067869165  0.255713484
#> n     0.202149151  0.0005263032  0.018048991
#> s     0.003769722 -0.0924254802  0.256124149
#> ns   -0.481088194 -0.0983270477  0.197100216
#> na    0.438041696  0.4835442475 -0.019473052
#> ss    0.187478718  0.1734997047 -0.008684568