Section 22 Compare t.test & lm outputs


22.1 t.test output

\[ \large t.test(SBP \sim Group, \space data=pBP) \]


    Two Sample t-test

data:  SBP by Group
t = -2.8201, df = 18, p-value = 0.01134
alternative hypothesis: true difference in means between group A and group B is not equal to 0
95 percent confidence interval:
 -14.574153  -2.129847
sample estimates:
mean in group A mean in group B 
         98.938         107.290 


22.2 Anova of the lm object

\[ \large anova(lm(SBP \sim Group, data=pBP)) \]

Df Sum Sq Mean Sq F value Pr(>F)
Group 1 348.7795 348.7795 7.9528 0.0113
Residuals 18 789.4126 43.8563 NA NA


22.3 Outputs

  • df

  • SS

  • MS

  • t-statistic & F-statistic

  • P-value

  • Conclusion