0

I am trying to run an ANOVA to examine the difference between 4 treatments.

anova(lm(weight~treatment))
summary(lm(weight~treatment))

Which is returning:

Call:
lm(formula = weight ~ treatment)

Residuals:
      Min        1Q    Median        3Q       Max 
-0.046677 -0.016346 -0.001859  0.015679  0.070679 

Coefficients:
                Estimate Std. Error t value Pr(>|t|)    
(Intercept)    0.1233676  0.0038640  31.928   <2e-16 ***
treatmentmale  0.0007096  0.0055420   0.128   0.8983    
treatmentneg  -0.0099701  0.0053940  -1.848   0.0663 .  
treatmentpos   0.0017537  0.0048976   0.358   0.7207    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.0235 on 168 degrees of freedom
Multiple R-squared:  0.03832,   Adjusted R-squared:  0.02115 
F-statistic: 2.231 on 3 and 168 DF,  p-value: 0.08643

There are supposed to be 4 treatments: pos, male, female, and neg. Is female being used as the intercept? Both treatment and weight are listed as factors, advice I pulled from other posts, but are still aren't returning the coefficients.

  • 1
    You're correct. treatment = female is aliased out because your model is over parameterised. You can see all four treatments by using the model weight ~ treatment - 1, but the treatment effects (that is, the differences between treatment levels) will be numerically identical. The degrees of freedom are a good indication of what's going on. @AllanCameron was quicker on the close button than I was. – Limey Jun 30 '22 at 15:49
  • 1
    The intercept _is_ the estimate for `female`. The other factor levels are relative to it. See the explanation in the linked duplicate. – Allan Cameron Jun 30 '22 at 15:52
  • Thanks for this link and your advice. – Liam Sullivan Jun 30 '22 at 16:07

0 Answers0