In: Statistics and Probability
Student,HW,Ex,Ex.Other
1,0.85,0.87,0.71
2,0.96,0.89,0.58
3,0.97,0.87,0.94
4,0.96,0.93,0.88
5,0.93,0.81,0.82
6,0.97,0.75,0.91
7,0.92,0.95,0.77
8,0.35,0.40,0.64
9,0.90,0.91,0.95
10,0.73,0.69,0.1
11,0.00,0.00,0.99
12,0.97,0.89,0.99
13,0.69,0.95,0.96
14,0.83,0.73,0.96
15,0.96,0.85,0.92
16,0.00,0.58,0.95
17,0.93,0.90,0.96
18,0.83,0.97,0.92
19,0.93,0.61,0.79
20,0.98,0.80,0.85
21,0.99,0.95,0.89
22,0.83,0.75,0.82
23,0.97,0.92,0.74
24,0.72,0.85,0.77
25,0.99,0.94,0.81
26,0.97,0.91,0.64
,,,
,,,
,,,
given the following values.
Please conduct a t test for the two ex grades.
#### a
Please check the conditions for a t test and state your
assumptions.
#### b
What is the test statistic?
#### c
What is the p value?
#### d
Interpret the results in context.
#### e
Create a 95% Confidence Interval and explain the results.
#### f
Please explain why you did not complete a paired t test.
a.
From above QQ plot, we see that almost all difference between two ex grades are closed to reference line hence difference (=Ex1-Ex2) is normally distributed.
b. The test statistic= -0.41493
c. p-value= 0.6817
d. Since p-value>0.05, we conclude that there is
insignificant difference between means of two ex grades.
e. 95% Confidence Interval: (-0.13532743, 0.08994282)=(-0.1353,
0.0899).
We are 95% confident that the mean difference between two ex grades lies in (-0.1353, 0.0899).
f. Since we consider two ex grades from same student, hence
these observations are paired observations and the differences of
these paired observations come from normal distribution, so we use
paired t test.
R code:
X=matrix(c(0.87,0.71,
0.89,0.58,
0.87,0.94,
0.93,0.88,
0.81,0.82,
0.75,0.91,
0.95,0.77,
0.40,0.64,
0.91,0.95,
0.69,0.1,
0.00,0.99,
0.89,0.99,
0.95,0.96,
0.73,0.96,
0.85,0.92,
0.58,0.95,
0.90,0.96,
0.97,0.92,
0.61,0.79,
0.80,0.85,
0.95,0.89,
0.75,0.82,
0.92,0.74,
0.85,0.77,
0.94,0.81,
0.91,0.64),nrow=26,ncol=2,byrow=TRUE)
Ex1=X[,1];Ex2=X[,2]
qqnorm(Ex1-Ex2, pch = 1, frame = FALSE)
qqline(Ex1-Ex2, col = "steelblue", lwd = 2)
t.test(Ex1,Ex2,alternative ="two.sided",mu = 0, paired =TRUE,
conf.level = 0.95)
Output:
Paired t-test
data: Ex1 and Ex2
t = -0.41493, df = 25, p-value = 0.6817
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
-0.13532743 0.08994282
sample estimates:
mean of the differences
-0.02269231