I have two proportions and I need to see if they are associated somehow. The null hypothesis is that they are equal. I'm using R.

So I get the pooled proportion:

pp = (prop_1+prop_2)/(dim(dist_1)+dim(dist_2))

then the standard error:

se = sqrt((pp*(1-pp))/dim(dist_1)+(pp*(1-pp))/dim(dist_2))

then the z value:

z = ((prop_1-prop_2)-0)/se

and then p value:

pvalue = 2*(1-pnorm(abs(z)))

The problem is that using this formula the p value is 0 since the z value is too big. Should I use pt instead of pnorm in this case?


2 Answers 2


You haven't described your question very well, but it seems to me you are asking: Is it plausible that the two proportions were sampled from populations where the proportion "success" (whatever your outcome is) is equal.

Assuming you did the calculations correctly (you didn't give any of the key details), your P value is tiny. It isn't zero, but the program must report zero because it is less than some tiny threshold value.

Therefore your can say that IF the populations had equal proportions, it would be very unlikely to see such a large difference between proportions in randomly chosen samples of the size you had. Assuming it is scientifically plausible that the proportions are in fact different, you can conclude that that null hypothesis of no difference is probably false.

  • $\begingroup$ Ok thanks for the quick answer. I figured that it means the null hypothesis is false. But would it make sense to use pt instead of pnorm? in which case will it make better sense to use pt? if I use pt I get a very small pvalue but not 0. I mean could I give a more accurate pvalue with pt than with pnorm? $\endgroup$
    – Atirag
    Commented Jan 27, 2015 at 0:33
  • $\begingroup$ No Atirag, it would not make sense to using the $t$-distribution (via pt). There's at least an asymptotic argument for using a normal distribution in this case; there isn't a good basis for using the $t$. [Your surprise at the smallness of the p-value is certainly not a good reason to use a different null distribution.] $\endgroup$
    – Glen_b
    Commented Jan 27, 2015 at 3:59
  • $\begingroup$ @Atirag Why don't you give the two proportions and sample size, and the value of z you computed, so the q and a can be more complete for people who view it in the future. $\endgroup$ Commented Jan 27, 2015 at 4:05

+1 to @Harvey Motulsky. Let me add a quick note, just to address your explicit question. You should not use pt() instead of pnorm(). When you are working with normally distributed data, but you have to estimate the group SDs from the same data, you have to account for the fact that the SDs you are using are not exact. This 'inexactness' means that the sampling distribution will vary a little differently (and a little more widely) than the normal. In fact, the specific distribution is the $t$-distribution. That is why, with normally distributed data, we use $t$-tests, and to look up the $p$-value from a $t$-distribution, you use pt(). However, with binomial proportions, the SD is a function of the mean. Once you have estimated the proportion, you already have the SD; there isn't an extra source of uncertainty. Thus, you use pnorm().


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.