Learn R Programming

heplots (version 1.8.5)

stdcoef: Standardized Regression Coefficients

Description

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 lm stdcoef(object, ...)

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

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).

Arguments

object

A fitted "lm" or "mlm" object

...

Additional arguments. Not used.

Author

Michael Friendly

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()

Examples

Run this code
data(Prestige, package = "carData")
prestige.mod <- lm(prestige ~ income + education, data = Prestige)
stdcoef(prestige.mod)

rohwer.mod <- lm(cbind(SAT, PPVT, Raven) ~ SES + n + s + ns + na + ss, data = Rohwer)
stdcoef(rohwer.mod)

Run the code above in your browser using DataLab