pairs->root, pivot_value_new_user_text_nocopy (make_pair_name (vp)));
double n = mc[i].n00 + mc[i].n01 + mc[i].n10 + mc[i].n11;
- double sig = gsl_cdf_binomial_P (mc[i].n01, 0.5, mc[i].n01 + mc[i].n10);
+ double sig = gsl_cdf_binomial_P ((mc[i].n01 > mc[i].n10) ? mc[i].n10: mc[i].n01,
+ 0.5, mc[i].n01 + mc[i].n10);
+
double point = gsl_ran_binomial_pdf (mc[i].n01, 0.5,
mc[i].n01 + mc[i].n10);
double entries[] = { n, 2.0 * sig, sig, point };
AT_CLEANUP
+AT_SETUP([NPAR TESTS McNemar Symetricity])
+
+AT_DATA([mcnemar.sps], [dnl
+data list notable list /var1 var2 w (F2.0).
+begin data
+0 0 9
+0 1 8
+1 0 1
+1 1 5
+end data.
+
+weight by w.
+
+NPAR TEST
+ /MCNEMAR var1 WITH var2 (PAIRED).
+
+NPAR TEST
+ /MCNEMAR var2 WITH var1 (PAIRED).
+])
+
+AT_CHECK([pspp -O format=csv mcnemar.sps], [0], [dnl
+Table: var1 & var2
+,var2,
+var1,0,1
+0,9,8
+1,1,5
+
+Table: Test Statistics
+,N,Exact Sig. (2-tailed),Exact Sig. (1-tailed),Point Probability
+var1 & var2,23,.039,.020,.02
+
+Table: var2 & var1
+,var1,
+var2,0,1
+0,9,1
+1,8,5
+
+Table: Test Statistics
+,N,Exact Sig. (2-tailed),Exact Sig. (1-tailed),Point Probability
+var2 & var1,23,.039,.020,.02
+])
+
+AT_CLEANUP
+
AT_SETUP([NPAR TESTS Kolmogorov-Smirnov Uniform parameters given])
AT_DATA([ks-uniform.sps], [dnl