% The data reported in the table below are taken from the original
% paper by Wilcoxon (1945) which discusses both WSiRT and WSuRT.
% It gives the results of fly spray tests on two preparations
% in terms of percentage mortality.
% Eight replications were run on each preparation.
% 
% Sample A Sample B
% Percent kill Rank Percent kill Rank
% 68 12.5 60 4
% 68 12.5 67 10
% 59 3 61 5
% 72 15 62 6
% 64 8 67 10
% 67 10 63 7
% 70 14 56 1
% 74 16 58 2
% Total 542 91 494 45
% 
% Rank numbers have been assigned to the results
% in order of magnitude. Where the mortality
% is the same in two or more tests, those
% tests are assigned the mean rank value. The
% sum of the ranks for B is 45 while for A the
% sum is 91. Wilcoxon lists
% probability of a total as low as 45 or lower,
% to be between 0.0104 and 0.021.
n1 = 8; n2=8; n=n1+n2;
pvalue = wsurtcdf(45, n1, n)

pvalue =  normcdf(45,  n1*(n+1)/2, sqrt(n1*n2*(n+1)/12))


