Supplementary Exercise 7.68 of IPS7e ------------------------------------ (same data as in Supplementary Exercise 7.58 of IPS7e) Data: 34 difference scores of preschool children in tests for spatial-temporal reasoning after and before attending piano lessons. Model: the 34 observations are a simple random sample (i.i.d. sample) from a distribution corresponding to a population of difference scores for children that attend piano lessons. As we'll use a nonparametric method, the population parameter of interest is the median. Estimation: estimated median=4.0 (from Exercise 7.58) 95% CI for median: (3,5) - from Minitab listing below (use interval with confidence level 95% obtained by non-linear interpolation (NLI)). Hypothesis H0: median=0 (no improvement by the piano lessons), alternative hypothesis Ha: median>0 (some improvement) The hypotheses may also be stated in terms of the probability p of an improvement (that is, the (non-zero) difference after-before is positive): H0: p=0.5 vs. Ha: p>0.5. Test: sign test using 28 positive and 4 negative differences, P=P(Y>=28) where Y follows B(32,0.5), and from Minitab/Stata analyses for the sign test we get an exact P-value less than 0.00005 (the actual value calculated in the binomial distribution is 0.0000097). We may also compute an approximate P-value using either the z-test for 1 proportion, or the normal approximation to B(32,0.5). These approaches are really only of interest if we don't have access to software, or in lucky cases a table for the binomial distribution in question, to allow us to compute the exact P-value. The approximation of B(32,0.5) by a normal distribution gives: P ~= 1-P(Z<(28-0.5-16)/sqrt(32*0.5*0.5)) = 1-P(Z<4.066) = P(Z<-4.066) = 0.000024 This computation involves a continuity-correction in the binomial distribution. The approximation is barely applicable because its condition is not met (32*0.5*(1-0.5)=8<10), but the weaker condition given in the textbooks are met (32*0.5=16 and 32*(1-0.5)=16 >10). The classical z-test for 1 proportion gives: P ~= P(z> (28/32-0.5)/sqrt(0.5*0.5/32)) = P(z> 4.243) = P(z<-4.243) = 0.000011. The conditions for use of this test are met (32*0.5=16 and 32*(1-0.5)=16>10). Conclusion: the test gives very strong evidence of a positive median in the distribution of differences. We can be pretty sure that the scores are more likely to be higher than lower on the second measurement (after the piano lessons). As a final note, our previous analyses in 7.58 and 7.59 did not identify any substantial problems with the normal distribution assumption. Therefore, the need for a non-parametric analysis is not obvious, and it is no surprise that our conclusions are very similar to those of the normal distribution analysis. --- Minitab commands and output: MTB > WOpen "H:\VHM\VHM801\Datasets\Minitab\Chapter 7\ex07_058.mtw". Retrieving worksheet from file: 'H:\VHM\VHM801\Datasets\Minitab\Chapter 7\ex07_058.mtw' Worksheet was saved on 09/10/2014 MTB > SInterval 95.0 'change'. Sign CI: change Sign confidence interval for median Confidence Achieved Interval N Median Confidence Lower Upper Position change 34 4.000 0.9424 3.000 5.000 12 0.9500 3.000 5.000 NLI 0.9757 3.000 5.000 11 MTB > STest 0.0 'change'; SUBC> Alternative 1. Sign Test for Median: change Sign test of median = 0.00000 versus > 0.00000 N Below Equal Above P Median change 34 4 2 28 0.0000 4.000 MTB > CDF 4; SUBC> Binomial 32 .5. Cumulative Distribution Function Binomial with n = 32 and p = 0.5 x P( X <= x ) 4 0.0000097 MTB > POne 32 28; SUBC> Test .5; SUBC> Confidence 95.0; SUBC> Alternative 1. Test and CI for One Proportion Test of p = 0.5 vs p > 0.5 Exact Sample X N Sample p 95% Lower Bound P-Value 1 28 32 0.875000 0.736403 0.000