[R] [External] Possible bug

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Mar 17 19:30:09 CET 2022


... and just a note, use the data argument in aov (and lm and other
modeling functions):
aov(uptake ~ Plant * Treatment, data = CO2)
Makes the code more readable. Also note, you probably meant ~Plant +
Treatment, as interactions are meaningless here. See ?lm for the
syntax of model specification.

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Thu, Mar 17, 2022 at 11:10 AM Richard M. Heiberger <rmh using temple.edu> wrote:
>
> > with(CO2, table(Treatment, Plant))
>             Plant
> Treatment    Qn1 Qn2 Qn3 Qc1 Qc3 Qc2 Mn3 Mn2 Mn1 Mc2 Mc3 Mc1
>   nonchilled   7   7   7   0   0   0   7   7   7   0   0   0
>   chilled      0   0   0   7   7   7   0   0   0   7   7   7
> >
>
>
> Plants are nested within Treatments.
> Hence when Plant is first, it picks up the effect of Treatment.
>
> You can see that in the sums of squares and degrees of freedom from both ANOVA tables.
>
> > summary(aov(CO2$uptake~CO2$Treatment*CO2$Plant))
>               Df Sum Sq Mean Sq F value   Pr(>F)
> CO2$Treatment  1    988   988.1  14.685 0.000269 ***
> CO2$Plant     10   3874   387.4   5.757 2.66e-06 ***
> Residuals     72   4845    67.3
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> > summary(aov(CO2$uptake~CO2$Plant*CO2$Treatment))
>             Df Sum Sq Mean Sq F value   Pr(>F)
> CO2$Plant   11   4862   442.0   6.569 1.84e-07 ***
> Residuals   72   4845    67.3
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
>
> > On Mar 17, 2022, at 10:17, konrad via R-help <r-help using r-project.org> wrote:
> >
> > summary(aov(CO2$uptake~CO2$Plant*CO2$Treatment))'
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list