Professor Inarb claims that 50% of his students in a large class achieve a final score 90 points or and higher. A suspicious student asks 17 randomly selected students from Professor Inarb’s class and they report the following scores. "80 81 87 94 79 78 89 90 92 88 81 79 82 79 77 89 90"
Test the hypothesis that the Professor Inarb‘s claim is not consistent with the evidence. i.e., that the 50%-tile (0.5-quantile, median) is not equal to 90. Use a = 0.05.
I order the 17 number from lower to higher number : 77 78 79 79 79 80 81 81 82 87 88 89 89 90 90 92 94 - - - - - - - - - - - - - + + + +
then I define the hypothesis H0 : final score of the class >= 90 H1 : final score of the class !>= 90
number of + = 2 (without 90)
number of - = 13 >>>> 15
Test statistics = 2
X ~ B (15 , 0.5)
X : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
5% Significance level
from the binomial table "using p=0.5" we observe that [0 1 2 3 ] is CR Accept H0 and the rest CR reject H0. So in the end, our TS=2 and number 2 is in the acceptance region.
Is my way of solving the question is right?
Assume that your 17 students are chosen at random from the "large" class. Call it a Success when one of your observations is 90 or above. If the professor's claim is true, then $P(Success) = .5$
In your sample, you have only $X=4$ Successes among 17. If $X \sim \mathsf{Binom}(17, .5),$ then $P(X \le 4) = 0.0245,$ as calculated in R below. So the null hypothesis that the success probability is 1/2 or more, is rejected with P-value 0.0245.
Notes: It is clear that you have chosen to do a one-sided median test, but the power of that test is notoriously low. Here are notes on two possible alternative tests.
(1) If test scores are nearly normal, then you might say that the claim amounts to saying that the population mean is 90 or above. (The data are just barely consistent with a normal sample according to the Shapiro-Wilk test, so a strict normality assumption might not be warranted.)
A one-sample t test rejects $H_0: \mu \ge 90$ against $H_1: \mu < 90)$ with P-value 0.004. (There are no outliers, so maybe $n=17$ is large enough to rely on the well-known robustness of t tests against non-normality.)
(2) A nonparametric one-sample Wilcoxon signed-rank test does not assume normality. It also rejects the null hypothesis that the median is at least 90, against the alternative that the median is smaller. (The exact P-value may not be exactly correct because of ties in the data; the signed rank test in R is programmed to give reasonable approximations.)
(By randomly 'jittering' the data to break ties artificially, we got P-values between 0.001 and 0.002. Results of one such jittering are shown below.)