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)

Warning! For IE7+Vista users the applet will -can only!- write the updated file to your <UserHome>\AppData\LocalLow
directory. (and the AppData directory is
a "hidden" directory that you will have to "unhide" with in explorer - see below.) Sorry about that :-(. To get around this you can always install the program on your desktop.

Follow these steps to display hidden files and folders.

Click Start>Control Panel>Folder Options.

Click the View tab.,

Under Advanced settings, click Show hidden files and folders, and then click OK.

Or you could just get FireFox
. Now there's a good idea!

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.