Hi: I would like to write a function that takes as its input a formula and outputs normalized coefficients ( coef(x)*sdv(x)/sdv(y) ). now, a formula is an object, and I cannot see how to extract the variables for obtaining sdv's. the intent is to write something like


        my.print.lm( formula ) {
          model <- lm(formula);
          coefs <- (t(summary.lm(model)))[1,];
          tvals <- (t(summary.lm(model)))[3,];
          for (i in 1:length( formula.contents.length ) ) {
            normcoefs[i] <- coefs[i]*sd( formula.coef[i] )
                                /sd( formula.yvar ); }
          # now I can do nice printing
        }

my.print.lm ( y~x+z );

or something like it. If this is not easy, please just tell me. I just do not want to spend a day to reinvent a wheel that is very simple for an R statistician. help appreciated.

regards,

/iaw

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to