Nonparametric statistical tests, 1 or 2 samples#
Sign test: p-value and confidence interval#
Sign test: power and sample size#
Brown-Mood median test for 2 independent samples: p-value and confidence interval#
Brown-Mood median test for 2 independent samples: power and sample size#
Wilcoxon’s signed rank \(T\) test: p-value and confidence interval, continuous data#
- ctx.signed_rank_test(x, k, n, method='default')#
where
ctxisdec,mpm, orgmp.Returns the results of the Wilcoxon’s signed rank \(T\) test, under \(H_0\). See also: Wikipedia [1585].
We consider \(N\) continuously distributed random variables \(D_i,i=1\ldots N\), with common pdf \(h_0\). In a sample \((d_1,\ldots,d_N)\) of size \(N\) let \(r_i\) be the rank of \(d_i\) in the ordered sample.
The test criterion of Wilcoxon’s Signed Rank is \(T_N=\sum_{i=1}^N S(d_i)r_i\), where \(S(d_i)=1\) for \(x>0\) and \(S(d_i)=0\) for \(x<0\). \(T_N\) can assume values between 0 and \(\tfrac{1}{2}N(N+1)\) in steps of 1.
Wilcoxon’s signed rank test \(T\) (Bennett alternatives): power and sample size#
where
ctxisdec,mpm, orgmp.
Mann-Whitney \(U\) test (stratified): p-value and confidence interval, continuous data#
- ctx.mannwhitney_test(x, k, n, method='default')#
where
ctxisdec,mpm, orgmp.Returns the results of the Mann-Whitney \(U\) test, under \(H_0\). See also: Wikipedia [1575].
See also: Mehrotra (2006): Rank-Based Analyses of Stratified Experiments: Alternatives to the van Elteren Test
Let \(x1,\ldots,x_m\) and \(y1,\ldots,y_n\) be two sets of measurements, which we denote by \(X\) and \(Y\). The test criterion \(U\) of the Mann-Whitney test is then
\[U = \sum_{i=1}^m \sum_{j=1}^n \text{sgn}(x_i - y_j)\]