[R] Getting betas in lm
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Thu Apr 27 11:16:12 CEST 2000
Prof Brian D Ripley <ripley at stats.ox.ac.uk> writes:
> On Thu, 27 Apr 2000, Ragnar Beer wrote:
>
> > Howdy,
> >
> > is there a simple way to get beta weights from lm? So far I've done
> > z-transformations of the variables before using them in lm.
>
> Could you please explain your notation? coef(fit) gives the coefficients,
> which may be what you want.
This is probably the SPSS abomination for "standardized coefficients"
sticking its head up, i.e. coefficients multiplied by the SD of the
corresponding x. [This is really great fun when you use SPSS along
with teaching materials which uses beta for (the true value of) the
regression parameters, which *is* the standard notation in theoretical
statistics.]
z-transforming is correct (insofar as the whole concept makes sense).
If you have only numeric predictors, it might be handy to give it as a
matrix scale(cbind(x1,x2,...)), for the general case, one could do
that to model.matrix(formula), but it gets unwieldy to give a general
solution (and the interpretation of std.coef. for factor contrasts is
dubious anyway). Watch out for NAs, by the way!
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list