In: Math
Use the ”test.vs.grade” data and test the null hypothesis that the mean test score for the population is 70 against the alternative that it is greater than 70. Find a p-value and state your conclusion if α = 0.05. Repeat for the null hypothesis µ = 75.
https://www.math.uh.edu/~charles/data/test.vs.grade.csv
To test the given hypotheses:
against
We obtain the test statistic as :
with degrees of freedom
where
Now, we reject the null hypothesis if:
where
Hence, we observe that, and thus reject the null hypothesis and conclude that the mean test score for the population is greater than 70.
Similarly, to test the given hypotheses:
against
We obtain the test statistic as :
with degrees of freedom
where
Now, we reject the null hypothesis if:
where
Hence, we observe that, and thus we do not reject the null hypothesis and conclude that the mean test score for the population may be equal to 75.
R-Code for the two tests are provided below:
> data = read.csv("test.vs.grade.csv")
> data$Test[is.na(data$Test)]=mean(data$Test, na.rm = T)
> data
Test Grade
1 76.00000 B
2 72.00000 D
3 92.00000 F
4 76.66038 D
5 80.00000 C
6 84.00000 B
7 96.00000 A
8 96.00000 A
9 84.00000 A
10 92.00000 B
11 84.00000 C
12 96.00000 A
13 68.00000 C
14 96.00000 A
15 72.00000 F
16 44.00000 W
17 88.00000 B
18 80.00000 C
19 88.00000 B
20 88.00000 C
21 68.00000 F
22 100.00000 A
23 92.00000 B
24 68.00000 W
25 100.00000 A
26 76.66038 C
27 76.00000 A
28 88.00000 B
29 76.66038 F
30 76.66038 B
31 96.00000 A
32 92.00000 A
33 92.00000 A
34 76.00000 C
35 92.00000 C
36 76.66038 B
37 88.00000 B
38 36.00000 D
39 40.00000 F
40 84.00000 A
41 52.00000 F
42 84.00000 D
43 80.00000 C
44 52.00000 D
45 76.00000 W
46 72.00000 B
47 88.00000 B
48 32.00000 W
49 88.00000 C
50 76.66038 F
51 76.00000 F
52 92.00000 D
53 80.00000 A
54 68.00000 D
55 76.66038 D
56 84.00000 A
57 76.66038 B
58 100.00000 A
59 88.00000 C
60 92.00000 A
61 36.00000 W
62 56.00000 W
63 84.00000 A
64 96.00000 A
65 64.00000 C
66 92.00000 D
67 84.00000 F
68 76.00000 W
69 40.00000 W
70 100.00000 A
71 72.00000 B
72 92.00000 A
73 72.00000 C
74 72.00000 A
75 76.66038 F
76 76.00000 A
77 72.00000 F
78 72.00000 B
79 40.00000 F
80 68.00000 B
81 84.00000 C
82 92.00000 A
83 72.00000 W
84 36.00000 W
85 84.00000 A
86 84.00000 A
87 76.66038 C
88 88.00000 A
89 92.00000 A
90 72.00000 B
91 88.00000 A
92 88.00000 D
93 100.00000 A
94 92.00000 B
95 60.00000 W
96 48.00000 D
97 76.66038 B
98 96.00000 A
99 56.00000 F
100 80.00000 B
101 40.00000 F
102 84.00000 C
103 84.00000 A
104 72.00000 C
105 76.66038 C
106 96.00000 A
107 100.00000 F
108 68.00000 F
109 64.00000 W
110 80.00000 D
111 100.00000 B
112 72.00000 F
113 72.00000 A
114 60.00000 W
115 28.00000 W
116 80.00000 A
117 64.00000 D
118 92.00000 B
119 76.00000 F
120 92.00000 A
121 76.00000 F
122 100.00000 A
123 92.00000 A
124 80.00000 C
125 64.00000 W
126 84.00000 F
127 80.00000 F
128 72.00000 D
129 76.66038 B
130 68.00000 F
131 76.66038 W
132 117.00000 W
133 48.00000 D
134 80.00000 B
135 76.00000 B
136 88.00000 B
137 76.66038 A
138 80.00000 F
139 100.00000 F
140 24.00000 C
141 76.66038 B
142 52.00000 F
143 76.00000 D
144 72.00000 C
145 76.00000 D
146 96.00000 B
147 44.00000 W
148 72.00000 F
149 80.00000 B
150 68.00000 F
151 72.00000 F
152 60.00000 F
153 76.00000 C
154 84.00000 W
155 72.00000 C
156 76.66038 B
157 88.00000 C
158 72.00000 F
159 80.00000 D
160 72.00000 A
161 76.66038 F
162 88.00000 A
163 84.00000 D
164 60.00000 C
165 84.00000 A
166 92.00000 F
167 76.66038 D
168 64.00000 B
169 76.00000 A
170 56.00000 W
171 32.00000 F
172 92.00000 A
173 76.00000 D
174 68.00000 B
175 72.00000 B
176 100.00000 A
177 96.00000 A
178 76.66038 W
179 40.00000 W
> m = mean(data$Test, na.rm=T)
> m ##
[1] 76.66038
> i=0
> s=0
> for (i in 1:length(data$Test))
+ {
+ s=s+(data$Test[i]-m)^2
+ }
> s=s/(length(data$Test)-1)
> s ##
[1] 273.3239
Now, the test for both the tests are obtained as:
> t_calculated1=(m-70)/sqrt(s/length(data$Test))
> t_calculated1
[1] 5.389972
> t_calculated2=(m-75)/sqrt(s/length(data$Test))
> t_calculated2
[1] 1.343676
> t = qt(0.95,178)
> t ##
[1] 1.653459