Re: [R] How to obtain the model/equation at each level automatically in a regression model with a few factors

2013-02-06 Thread chunlin liu
Thanks, Andrew. I studied the function estimable in package gmodels and realized that it could combine the model coefficients together if a correct cm matrix is provided. For example, if mylm - lm(y ~ x1 + factor(x2) + x3*factor(x4), mydata) Assume that factors x2 and x4 have 6 and 10

Re: [R] How to obtain the model/equation at each level automatically in a regression model with a few factors

2013-02-06 Thread Andrew Robinson
Hi Chunlin, You have to write your own myCmatrix. Cheers Andrew On Wednesday, February 6, 2013, chunlin liu wrote: Thanks, Andrew. I studied the function estimable in package gmodels and realized that it could combine the model coefficients together if a correct cm matrix is

[R] How to obtain the model/equation at each level automatically in a regression model with a few factors

2013-02-05 Thread chunlin liu
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

Re: [R] How to obtain the model/equation at each level automatically in a regression model with a few factors

2013-02-05 Thread Andrew Robinson
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