Hello!
I'm wondering if there's a way to compare proportions across two subpopulations from a single survey-weighted sample.
For example, I want to test whether there's a difference between the prevalence of males between two non-mutually exclusive subpopulations, cohort_a and cohort_b, and generate a p-value:
Thanks in advance!
I'm wondering if there's a way to compare proportions across two subpopulations from a single survey-weighted sample.
For example, I want to test whether there's a difference between the prevalence of males between two non-mutually exclusive subpopulations, cohort_a and cohort_b, and generate a p-value:
Code:
. svy, subpop(cohort_a): proportion male (running proportion on estimation sample) Survey: Proportion estimation Number of strata = 24 Number of obs = 15,560 Number of PSUs = 49 Population size = 322,324,172 Subpop. no. obs = 211 Subpop. size = 4,763,840.19 Design df = 25 -------------------------------------------------------------- | Linearized Logit | Proportion Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ male | 0 | .4747481 .0527103 .3690163 .5827937 1 | .5252519 .0527103 .4172063 .6309837 -------------------------------------------------------------- . svy, subpop(cohort_b): proportion male (running proportion on estimation sample) Survey: Proportion estimation Number of strata = 24 Number of obs = 15,560 Number of PSUs = 49 Population size = 322,324,172 Subpop. no. obs = 520 Subpop. size = 12,796,639.8 Design df = 25 -------------------------------------------------------------- | Linearized Logit | Proportion Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ male | 0 | .489929 .0349094 .4187285 .5615404 1 | .510071 .0349094 .4384596 .5812715 --------------------------------------------------------------
Thanks in advance!
Comment