Adds standardized regression coefficients to objects created by
object of type
Calculates the standardized regression coefficients by common method used for example in SPSS. For translating the formula, functions
model.matrix (for the right-hand side) and
model.frame (for the left-hand side) are used, so all options saved in the
lm-object are supported.
lm.beta standardizes the coefficients after estimating them using the standard deviations or similar measures of the used variables. So there are unstandardized and standardized coefficients available simultaneously.
Standardizing before estimating is not (yet) available in this package, but by using the command
scale you can do this by using basic commands. Hereby please regard that the option
center influences the way of interpretation of the intercept.
lm.beta standardizes all coefficients disregarding the use in interpretation. In this version, all types of scales of the variables (metrical, categorical, ...), all types of contrasts, interaction effects and additional terms on both sides of the formula can be handled if
lm can handle them. The sensitive use in interpretation has to be regarded by the user.
A list of class
lm.beta like a
lm-object extended by
standardized.coefficients named vector of the standardized coefficients.
Some S3 methods, where standardized coefficients mind, are extended, the others work unchanged.
Stefan Behrendt, email@example.com
Urban, D., Mayerl, J., Sackmann, R. (Hrsg.) Regressionsanalyse : Theorie, Technik und Anwendung, VS-Verlag, 4. Aufl.
Vittinghoff, E. et al (2005) Regression methods in biostatistics: Linear, logistic, survival, and repeated measures models, Springer, p 75
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## Taken from lm help ## ## Annette Dobson (1990) "An Introduction to Generalized Linear Models". ## Page 9: Plant Weight Data. ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2, 10, 20, labels = c("Ctl","Trt")) weight <- c(ctl, trt) lm.D9 <- lm(weight ~ group) # standardize lm.D9.beta <- lm.beta(lm.D9) print(lm.D9.beta) summary(lm.D9.beta) coef(lm.D9.beta)
Call: lm(formula = weight ~ group) Standardized Coefficients:: (Intercept) groupTrt 0.0000000 -0.2703287 Call: lm(formula = weight ~ group) Residuals: Min 1Q Median 3Q Max -1.0710 -0.4938 0.0685 0.2462 1.3690 Coefficients: Estimate Standardized Std. Error t value Pr(>|t|) (Intercept) 5.0320 0.0000 0.2202 22.850 9.55e-15 *** groupTrt -0.3710 -0.2703 0.3114 -1.191 0.249 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6964 on 18 degrees of freedom Multiple R-squared: 0.07308, Adjusted R-squared: 0.02158 F-statistic: 1.419 on 1 and 18 DF, p-value: 0.249 (Intercept) groupTrt 0.0000000 -0.2703287
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.