[R] interpreting one-way anova tables
David Winsemius
dwinsemius at comcast.net
Mon Sep 20 18:12:47 CEST 2010
On Sep 20, 2010, at 11:53 AM, Jabez Wilson wrote:
> Hi, I am trying to reconcile anova table in R (summary(lm)) with
> individual t.test.
> datafilename="http://personality-project.org/R/datasets/R.appendix1.data
> "
> data.ex1=read.table(datafilename,header=T) #read the data into a
> table
> summary(lm(Alertness~Dosage,data=data.ex1))
The quick answer is that in the ANOVA situation where you are
interpreting individual level parameters, you are testing for the
difference of a particular group from a shared mean (the intercept)
across all three groups, whereas with the t-test you are only
considering two groups at a time. (The default treatment contrasts do
not actually result in the intercept estimate being a global mean,
however.)
--
David.
>
> gives:
>
> Call:
> lm(formula = Alertness ~ Dosage, data = data.ex1)
>
> Residuals:
> Min 1Q Median 3Q Max
> -8.500 -2.437 0.250 2.687 8.500
>
> Coefficients:
> Estimate Std. Error t value Pr(>|t|)
> (Intercept) 32.500 2.010 16.166 6.72e-11 ***
> Dosageb -4.250 2.659 -1.598 0.130880
> Dosagec -13.250 3.179 -4.168 0.000824 ***
> ---
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Residual standard error: 4.924 on 15 degrees of freedom
> Multiple R-squared: 0.5396, Adjusted R-squared: 0.4782
> F-statistic: 8.789 on 2 and 15 DF, p-value: 0.002977
>
> As far as I understand it the lines "Dosageb" and "DosageC"
> represent the difference between DosageA and the other two dosages.
> My question is this: are these differences and the p-values
> associated with them the same as a t.test or pairwise.t.test on
> these groups? If I do t.tests, I get different values for t and p-
> value from those in the anova table above.
> Can someone please explain what the discrepancy is?
> Thanks
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list