[R] Standardized beta-coefficients in regression

Gabor Grothendieck ggrothendieck at gmail.com
Mon Jan 16 17:37:58 CET 2006


Try this, possibly with a better name:

f <- function(formula, ...) {
	print(summary(lm(formula, ...)))
	formula <- update(formula, scale(.) ~ scale(.))
	print(summary(lm(formula, ...)))
}

f(ctl ~ trt)


On 1/16/06, Dr. Walter H. Schreiber <whschreiber at onlinehome.de> wrote:
> Hello list,
>
> I am used to give a lot of attention to the standardized regression
> coefficients, which in SPSS are listed automatically.
>
> Is there alternative to running the last two lines in the following example to
> get all the information?
>
> 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)
> summary( lm(ctl ~ trt) )
> summary( lm(scale(ctl) ~ scale(trt)) )
>
> Any hints are appreciated.
>
>        Walter.
>
> --
> Dr. Walter H. Schreiber
> Dept. of Psychology
> University of Koblenz-Landau
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list