The Significance of the Difference Between Two Independent Proportions
RatioDiff computes the same p-values as this stats page. Just Drag and drop your Excel spreadsheet file onto the logo. Two extra sheets will be inserted "z-values" and "p-values"
You can also install this applet as a fully functioning program on your desktop (Look for the logo on your desktop)
Calculation
The computation is based on the comparison of proportions in paired samples. If the proportion of interest in the first sample
is pa = ka/na and that of the paired sample is pb = kb/nb and if
the ki's are not too small or too big and the ni's are not too small (Ratiodiff make no call on the bigness or smallness of the input values - caveat emptor), then by a well known
theorem of statistics the pi's are normally distributed with standard deviation and so is the difference pa - pb. If pa is not so different from pb we can compute
where p is the total proportion (ka + kb)/(na + nb) so that z is normally distributed U(0,1). From this the single tailed p value - the probability that a similar sample of z is greater than *this* z is given by
where erf is the error function
Layout of Excel Spreadsheet
The first sheet should contain the following layout of numbers.The rows should be marked with the keys ka ... kb
etc. Formatting is irrelevent: we use the regular expression (k|n)\\s*([^\\s=]+)\\s*= — that is to say we look for the text k or n followed by some character followed by an equals sign with any spaces in between allowed. The first "column"
will be compared with the others. At the bottom there should be a row giving the totals
marked by na ... nb etc.
| At the top of sheet one.... |
|
| etc. etc. And near the bottom of sheet one.... |
|
This work is licenced under a Creative Commons Licence.




