In: Statistics and Probability
The following data represent the results of an independent-measures study comparing two treatment conditions.
Treatment One |
Treatment Two |
---|---|
3.3 | 2.6 |
5 | 4.4 |
3.6 | 3.3 |
5.4 | 6 |
6.2 | 2.8 |
5.4 | 5.1 |
4.3 | 2.6 |
4.6 | 2.5 |
Run the single-factor ANOVA for this data:
F-ratio:
p-value:
Now, run the t test on the same data:
t-statistic:
p-value:
Using R code we can have the answers.
CODE:
trt1 <- c(3.3,5,3.6,5.4,6.2,5.4,4.3,4.6)
trt2 <- c(2.6,4.4,3.3,6,2.8,5.1,2.6,2.5)
var <- c(trt1,trt2)
trt <- as.factor(c(rep("trt1",8),rep("trt2",8)))
#ANOVA
summary(aov(var~trt))
#t test
t.test(trt1,trt2)
OUTPUT:
> trt1 <- c(3.3,5,3.6,5.4,6.2,5.4,4.3,4.6)
> trt2 <- c(2.6,4.4,3.3,6,2.8,5.1,2.6,2.5)
> var <- c(trt1,trt2)
> trt <- as.factor(c(rep("trt1",8),rep("trt2",8)))
>
> #ANOVA
> summary(aov(var~trt))
Df Sum Sq Mean Sq F value Pr(>F)
trt 1 4.516 4.516 3.29 0.0912 .
Residuals 14 19.214 1.372
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> #t test
> t.test(trt1,trt2)
Welch Two Sample t-test
data: trt1 and trt2
t = 1.8139, df = 12.792, p-value = 0.09321
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
-0.2050275 2.3300275
sample estimates:
mean of x mean of y
4.7250 3.6625
For ANOVA:
F-ratio = 3.2.
P-value = 0.0912.
For t-test:
t-statistic = 1.8139.
P-value = 0.09321.