Generate Proportions in Stata using svy:proportion

Statements Explanation

use " C:\nhanes\data\analysis_data.dta",
clear

 

Use the use command to load the Stata-format dataset. Use the clear option to replace any data in memory.

svyset sdmvpsu [pweight=wtmec4yr], strata(sdmvstra) vce(linearized)

Use the svyset command to declare the survey design for the dataset. Specify the psu variable sdmvpsu. Use the [pweight=] option to account for the unequal probability of sampling and non-response.  In this example, the MEC weight for four years of data (wtmec4yr) is used. Use the strata( ) option to specify the stratum identifier (sdmvstra). Use the vce( ) option to specify the variance estimation method (linearized) for Taylor linearization.

svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion hbp

 

Use the svy : proportion command  with the high blood pressure variable (hbp) to estimate the prevalence of HBP. Use the subpop( ) option to select a subpopulation for analysis, rather than select the study population in the Stata program while preparing the data file. 

svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion hbp, over(riagendr)

 

Use the svy : proportion command  with the high blood pressure variable (hbp) to estimate the prevalence of HBP. Use the subpop( ) option to select a subpopulation for analysis, rather than select the study population in the Stata program while preparing the data file.  Use the over( ) option to specify subgroup tabulations for estimates requested. In this example, gender (riagendr) is of interest.

svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion hbp, over(race)

Use the svy: proportion command with the high blood pressure variable (hbp) to estimate the prevalence of HBP. Use the subpop( ) option to select a subpopulation for analysis, rather than select the study population in the Stata program while preparing the data file. Use the over ( ) option to specify subgroup tabulations for estimates requested. In this example, race-ethnicity (race) is of interest.

svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion hbp, over(age)

 

Use the svy: proportion command with the high blood pressure variable (hbp) to estimate the prevalence of HBP. Use the subpop( ) option to select a subpopulation for analysis, rather than select the study population in the Stata program while preparing the data file. Use the over ( ) option to specify subgroup tabulations for estimates requested. In this example, age (age) is of interest.

svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion hbp, over(riagendr race age)

Use the svy: proportion command with the high blood pressure variable (hbp) to estimate the prevalence of HBP. Use the subpop( ) option to select a subpopulation for analysis, rather than select the study population in the Stata program while preparing the data file.  Use the over( ) option to specify subgroup tabulations for estimates requested. In this example, gender (riagendr), race-ethnicity (race), and age (age) are of interest.