Functions | |
if (nargin==4) alt | |
Variables | |
function [pval, z] | |
endif | p1 = x1 / n1 |
p2 = x2 / n2 | |
pc = (x1 + x2) / (n1 + n2) | |
z = (p1 - p2) / sqrt (pc * (1 - pc) * (1/n1 + 1/n2)) | |
cdf = stdnormal_cdf (z) |
if | ( | nargin | = =4 |
) |
cdf = stdnormal_cdf (z) |