Re: [R] Loop with string variable AND customizable "summary" output

From: Marc Schwartz <marc_schwartz_at_comcast.net>
Date: Mon 29 Jan 2007 - 20:01:03 GMT

On Mon, 2007-01-29 at 14:30 -0500, Gabor Grothendieck wrote:
> Note that the nlme solution seems to give the same coefficients
> but appears to use a single error term rather than one error
> term per level of the conditioning variable and that would change various
> other statistics relative to the other solutions should that matter.
>
> > summary(lmList(uptake ~ conc | Treatment, CO2))
> Call:
> Model: uptake ~ conc | Treatment
> Data: CO2
>
> Coefficients:
> (Intercept)
> Estimate Std. Error t value Pr(>|t|)
> nonchilled 22.01916 2.46416 8.935769 1.174616e-13
> chilled 16.98142 2.46416 6.891361 1.146556e-09
> conc
> Estimate Std. Error t value Pr(>|t|)
> nonchilled 0.01982458 0.004692544 4.224699 6.292679e-05
> chilled 0.01563659 0.004692544 3.332221 1.306259e-03
>
> Residual standard error: 8.945667 on 80 degrees of freedom

<snip>

Gabor,

Thanks for noting that. There is a solution using 'pool = FALSE':

> summary(lmList(uptake ~ conc | Treatment, CO2, pool = FALSE))
Call:
  Model: uptake ~ conc | Treatment
   Data: CO2

Coefficients:

   (Intercept)

           Estimate Std. Error   t value     Pr(>|t|)
nonchilled 22.01916   2.148475 10.248740 9.463480e-13
chilled    16.98142   2.743761  6.189103 2.562416e-07
   conc 
             Estimate  Std. Error  t value     Pr(>|t|)
nonchilled 0.01982458 0.004091379 4.845452 1.934996e-05 chilled 0.01563659 0.005224992 2.992653 4.721873e-03

I suppose that, while subtle, this could make this approach error prone for those who (like me in this case) miss it...

Then of course, we get down to the format of the output, etc.

:-)

Thanks Gabor,

Marc



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Tue Jan 30 07:23:38 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 29 Jan 2007 - 21:30:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.