Sign test and associated Hodges-Lehmann estimator and confidence interval - written by XXXXX. Data: Hamilton Depression Scale Factor IV (Salsburg 1970) See the text (Hollander+Wolfe 2nd ed) Table 3.1, page 39 Scale values before and after treatment for 9 patients. Program ONESAMP_SIGN - January 23, 2007 N=9 observations: No. Before After Diff(After-Before) Sign: 1. 1.830 0.878 -0.952 - 2. 0.500 0.647 0.147 + 3. 1.620 0.598 -1.022 - 4. 2.480 2.050 -0.430 - 5. 1.680 1.060 -0.620 - 6. 1.880 1.290 -0.590 - 7. 1.550 1.060 -0.490 - 8. 3.060 3.140 0.080 + 9. 1.300 1.290 -0.010 - Is there a significant decrease in the Depression Scale after treatment? A significant difference? Classical one-sample t-test (n=9) for X=After-Before: Mean=-0.432 Stdev(Mean)=0.142 T=-3.035 P=0.0162 2-sided t-test, df=8 Sign test: npos=2 positive out of nn=9 Exact sign test Pvalue by counting cases: P = (1(0+)+9(1+)+(9*8/2)(2+))/512 = 46/512 = 0.0898 (one-sided) P = 0.1797 (two-sided) Using the `binomtail' function in statlib.c: Exact Pval=0.0898 (one-sided) = 0.1797 (two-sided) Sign test (normal approximation): Npos-Xmean = 2-4.5 = -2.5 StdDev(Npos)=1.5000 Z=-1.6667 (p0=1/2) P=0.0956 (two-sided) NOTE HOWEVER that the sign test does not take into account the fact that the (+) values are smaller in absolute value. Hodges-Lehmann sign-test values: Median of 9 values=-0.490 Sorted differences (n=9): -1.022 -0.952 -0.620 -0.590 -0.490(*) -0.430 -0.010 0.080 0.147 For HL-like confidence interval, see text p75-76: Critical value b=b(alpha/2,9,1/2) for 1-alpha closest to 0.95: P[B(9) >= 5] = 0.5000 (0.0% CI) P[B(9) >= 6] = 0.2539 (49.2% CI) P[B(9) >= 7] = 0.0898 (82.0% CI) P[B(9) >= 8] = 0.0195 (96.1% CI) P[B(9) >= 9] = 0.0020 (99.6% CI) Selecting closest to 95%: P[B(9) >= 8] = 0.0195 (96.1% CI) Sign test CI offsets in (1,2,...,9): (2,8) Sign test CI offsets in (0,1,...,8): (1,7): -1.022 -0.952(*) -0.620 -0.590 -0.490 -0.430 -0.010 0.080(*) 0.147 Nonparametric 96.1% CI: (-0.952, 0.080) Two-sided Student-t critical values used for Student-t CI: Tcrit(8,0.05)=2.7515 Tcrit(300,0.05)=1.9679 CIs for `average' value of differences: Sample mean(T): -0.4319 (-0.8234, -0.0404) 95% CI Sample mean(Z): -0.4319 (-0.7108, -0.1530) 95% CI HL for sign test: -0.4900 (-0.9520, 0.0800) 96.1% CI