chunlin liu
2013-Feb-04 17:10 UTC
[R] How to obtain the model/equation at each level automatically in a regression model with a few factors
I am wondering how to obtain the model/equation at each level automatically in a regression model with a few factors without looking at summary of the lm model. For example, consider lm.factors <- lm(y ~ x1 + factor(x2)*factor(x3)+x4*factor(x5)) The coefficients of lm.factors in summary(lm.factors) might be complicated. I would like to have the equation at each level from lm.factor. Could you please let me know how to obtain the equation of lm.factors at each level automatically (not looking at summary(lm.factors))? Thanks, -Chunlin [[alternative HTML version deleted]]
Andrew Robinson
2013-Feb-05 08:56 UTC
[R] How to obtain the model/equation at each level automatically in a regression model with a few factors
I think that the excellent estimable function from gmodels should help you. Cheers Andrew On Tuesday, February 5, 2013, chunlin liu wrote:> I am wondering how to obtain the model/equation at each level automatically > in a regression model with a few factors > without looking at summary of the lm model. For example, consider > > lm.factors <- lm(y ~ x1 + factor(x2)*factor(x3)+x4*factor(x5)) > > The coefficients of lm.factors in summary(lm.factors) might be complicated. > I would like to have the equation at each level from lm.factor. > Could you please let me know how to obtain the equation of lm.factors at > each level automatically (not looking at summary(lm.factors))? > Thanks, > > -Chunlin > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org <javascript:;> mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Andrew Robinson Director (A/g), ACERA Department of Mathematics and Statistics Tel: +61-3-8344-6410 University of Melbourne, VIC 3010 Australia (prefer email) http://www.ms.unimelb.edu.au/~andrewpr Fax: +61-3-8344-4599 http://www.acera.unimelb.edu.au/ FAwR: http://www.ms.unimelb.edu.au/~andrewpr/FAwR/ SPuR: http://www.ms.unimelb.edu.au/spuRs/ [[alternative HTML version deleted]]