Stata software can be used to calculate proportions and standard errors for NHANES data because the software takes into account the complex survey design of NHANES data when determining variance estimates. If the standard errors are not needed, you simply could use a standard Stata command, i.e., svy: proportion with the weight statement. In this example, you will be looking at the proportion of examined persons 20 years and older with measured high blood pressure, by sex, age, and race-ethnicity.
|
According to the Joint National Committee on Prevention, Detection, Evaluation, and Treatment of High Blood Pressure, a person with hypertension is defined as either having elevated blood pressure (systolic pressure of at least 140 mmHg or diastolic of at least 90 mmHg) or taking antihypertensive medication.
You can code your variables in this example in two possible ways. Persons with high blood pressure, as defined above, are assigned a value of 1. All other sample persons are assigned a value of 2. The weighted percentage of sample persons with a value equal to 1 is an estimate of the prevalence of high blood pressure in the U.S.
|
Remember that you need to define the SVYSET before using the SVY series of commands. The general format of this command is below:
svyset [w=weightvar], psu(psuvar) strata(stratavar) vce(linearized)
To define the survey design variables for your cholesterol analysis, use the weight variable for four-yours of MEC data (wtmec4yr), the PSU variable (sdmvpsu), and strata variable (sdmvstra) .The vce option specifies the method for calculating the variance and the default is "linearized" which is Taylor linearization. Here is the svyset command for fur years of MEC data:
svyset [w= wtmec4yr], psu(sdmvpsu) strata(sdmvstra) vce(linearized)
In this example, you will use svy: proportion in Stata to generate proportions. You created a categorical variable, hbp, to indicate whether or not a person had high blood pressure. That categorical variable will be identified in the procedure and the weighted percent (prevalence) of sample persons with the value hbp=1 (high blood pressure) will be estimated along with the standard error.
The general format of the svy:proportion command is:
svy, subpop(if condition) vce(linearized): proportion varname
To generate the proportion of persons aged 20 years and older (ridageyr >=20 & ridageyr <.) with high blood pressure (hbp), the command would be:
svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): prop hbp

The general format of the svy:proportion command with the over option is:
svy, subpop(if condition) vce(linearized): proportion varname, over(var1)
Here is the command to generate the proportion of people aged 20 years and older (ridageyr >=20 & ridageyr <.) by gender (riagendr) with hypertension (hbp):
svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion varname, over(rigendr)

Here is the command to generate the proportion of people aged 20 years and older (ridageyr >=20 & ridageyr <.) by gender (riagendr), race-ethnicity (race), and age (ridageyr) with hypertension (hbp):
svy, subpop(if ridageyr >=20 & ridageyr <.) vce(linearized): proportion varname, over(rigendr race ridageyr)

Highlights from the output include: