Suppose you want to test whether or not boys like the T.V. show Jersey Shore better than girls. You ask 10 boys and 10 girls to rate the T.V. show on a scale from 1 to 7, where 7 is highly enjoyable and 1 is not enjoyable. For the boys, you observe the values: 5 7 6 3 1 1 2 4 5 6 For the girls, you observe the values: 1 3 7 7 6 4 3 5 7 4 #1.3) Look at a histogram for both groups. #1.4) Use the appropriate t-test to test the null hypothesis that mean score for boys=girls #1.5) Do you reject or fail to reject the null? Solve using R.
R code:
x <- c(5,7,6,3,1,1,2,4,5,6)
y<- c(1,3,7,7,6,4,3,5,7,4)
par(mfrow = c(1,2))
hist(x,main = "For boys")
hist(y,main = "For girls")
t.test(x,y)
> t.test(x,y)
Welch Two Sample t-test
data: x and y
t = -0.742, df = 17.957, p-value
= 0.4677
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-2.682343 1.282343
sample estimates:
mean of x mean of y
4.0 4.7
Here p-value is greater than 0.05, so we can't reject the null hypothesis at 5% level of confidence.
Get Answers For Free
Most questions answered within 1 hours.