# How to compare two sets of proportions?

#### sunny3333

##### New Member
Hi,

I have two sets of estimated proportions along with their standard errors from two different samples. My data looks like the following:

I don't have the original data from which the above estimates derived. Is there a way I can test if the two sets of proportions are equal? In other words I'd like to test if the distribution of the two samples by age group are the same. I know how to test the equality of two proportions in each row, but am not sure how to do a test to compare the two sets of proportions. If there are not those two standard error columns, I suppose I can just do a paired t-test. Any response will be greatly appreciated.

#### staassis

##### Active Member
Why "paired"? Also a t-test would not use the information on the reported standard errors. You should use methods of meta-analysis, fixed effects and random effects models in particular.

#### GretaGarbo

##### Human
You can compare age and the two samples with a usual chi-squared test. That would be an overall test.

But each pair of proportions (for each age) can be tested with this usual formula:

(p1-p2) +/- 1.96*sqrt(p1*(1-p1)/n1 + p2*(1-p2)/n2)

I guess that you can do as staassis suggest but in my view this is simpler.

#### sunny3333

##### New Member
You can compare age and the two samples with a usual chi-squared test. That would be an overall test.

But each pair of proportions (for each age) can be tested with this usual formula:

(p1-p2) +/- 1.96*sqrt(p1*(1-p1)/n1 + p2*(1-p2)/n2)

I guess that you can do as staassis suggest but in my view this is simpler.
Thanks, GretaGarbo! I know how to do the test for each pair (roll), but am not sure how to do an overall test comparing the two columns while making use of the standard errors.

#### sunny3333

##### New Member
Why "paired"? Also a t-test would not use the information on the reported standard errors. You should use methods of meta-analysis, fixed effects and random effects models in particular.
Thanks, Staassis! What I meant was that had I not have the standard errors but just the two columns of proportions, I could do a paired t-test. Am I right? But now I do have the standard errors and have to make use of them, that's where I'm stuck. Meta analysis sounds promising, unfortunately I know nothing about it. Could you elaborate a bit? Can I use SAS for it? If you could point me to a SAS or STATA example that would be even better. Thanks so much!

#### staassis

##### Active Member
Take a look at the Stata document that I have linked... The data do not seem to be paired, based on your description.

#### Dason

Hi sunny3333. Just so you know the "report" option is for reporting spam or other violations of forum rules. I believe you wanted to "reply" instead of report.

#### sunny3333

##### New Member
Hi sunny3333. Just so you know the "report" option is for reporting spam or other violations of forum rules. I believe you wanted to "reply" instead of report.
Yes I realized that Sorry.

#### sunny3333

##### New Member
Take a look at the Stata document that I have linked... The data do not seem to be paired, based on your description.