Hi there,
I am currently working on a secondary analysis of survey data, where only a subpopulation of the whole sample are eligible for inclusion in my analysis.
I have created a dummy variable in Stata to identify eligible observations, where 1 = eligible & 0 = non-eligible.
I have used the syvset command to inform Stata of the survey sample design: 'svyset w1psu [pweight = b_ind5mus_lw], strata(w1strata) singleunit(centered)'
However, when I attempt to use the subpop option after svy to obtain descriptive statistics, my sample size for the subpopulation is incorrect. For example, I would like to obtain the mean age for my subpopulation and used the following code - 'svy, subpop(completecase_DF): mean w1age_dv'. See output below:
Survey: Mean estimation
Number of strata = 470 Number of obs = 1,297
Number of PSUs = 1,065 Population size = 164.539813
Subpop. no. obs = 967
Subpop. size = 131.303466
Design df = 595
--------------------------------------------------------------
| Linearized
| Mean std. err. [95% conf. interval]
-------------+------------------------------------------------
w1age_dv | 38.45084 1.580497 35.34681 41.55487
--------------------------------------------------------------
Note: 71 strata omitted because they contain no subpopulation
members.
Note: Strata with single sampling unit centered at overall
mean.
subpop no. obs states my sample size is 967, however the sample size is 968. There is no missing data in the age variable so I unsure why the observation number is 1 less than expected.
Any information/guidance anyone can provide on why this may be the case would be really appreciated.
I am currently working on a secondary analysis of survey data, where only a subpopulation of the whole sample are eligible for inclusion in my analysis.
I have created a dummy variable in Stata to identify eligible observations, where 1 = eligible & 0 = non-eligible.
I have used the syvset command to inform Stata of the survey sample design: 'svyset w1psu [pweight = b_ind5mus_lw], strata(w1strata) singleunit(centered)'
However, when I attempt to use the subpop option after svy to obtain descriptive statistics, my sample size for the subpopulation is incorrect. For example, I would like to obtain the mean age for my subpopulation and used the following code - 'svy, subpop(completecase_DF): mean w1age_dv'. See output below:
Survey: Mean estimation
Number of strata = 470 Number of obs = 1,297
Number of PSUs = 1,065 Population size = 164.539813
Subpop. no. obs = 967
Subpop. size = 131.303466
Design df = 595
--------------------------------------------------------------
| Linearized
| Mean std. err. [95% conf. interval]
-------------+------------------------------------------------
w1age_dv | 38.45084 1.580497 35.34681 41.55487
--------------------------------------------------------------
Note: 71 strata omitted because they contain no subpopulation
members.
Note: Strata with single sampling unit centered at overall
mean.
subpop no. obs states my sample size is 967, however the sample size is 968. There is no missing data in the age variable so I unsure why the observation number is 1 less than expected.
Any information/guidance anyone can provide on why this may be the case would be really appreciated.

Comment