In this example, you will assess the association between high density lipoprotein (HDL) cholesterol and selected covariates in NHANES 1999-2002. These covariates include gender (riagendr), race/ethnicity (ridreth1), age (ridageyr), body mass index (bmxbmi), smoking (smoker, derived from SMQ020 and SMQ040; smoker =1 if non-smoker, 2 if past smoker and 3 if current smoker) and education (dmdeduc).
In order to subset the data in SAS Survey Procedures, you will need to create a variable for the population of interest. You should not use a where clause or by-group processing in order to analyze a subpopulation with the SAS Survey Procedures.
In this example, restrict the analysis to individuals with complete data for all the variables used in the final multiple regression model. Then this variable is used in the domain statement to specify the population of interest.
if (LBDHDL^=. and RIAGENDR^=. and RIDRETH1^=. and SMOKER^=. and DMDEDUC^=. and BMXBMI^=.) and WTMEC4YR>0 and (RIDAGEYR>=20)
then ELIGIBLE=1; else ELIGIBLE=2;
To change the reference level for a discrete variable, recode the variable so that the desired reference category has the highest level.
The variable riagendr was recoded to make men the reference category. The name of the recoded variable is sex.
If RIAGENDR EQ 1 then SEX=2;
Else if RIAGENDR EQ 2 THEN SEX=1;
The variable ridreth1 was recoded to make non-Hispanic Whites the reference group. The recoded variable is ethn.
ETHN= RIDRETH1;
If RIDRETH1 eq 3 then ETHN=5;
Else if RIDRETH1 eq 4 then ETHN=2;
Else if RIDRETH1 eq 2 then ETHN=3;
Else if RIDRETH1 eq 3 then ETHN=4;
The variable bmicat was recoded to make normal weight the the reference group. The recoded variable is bmicatf.
if 0 le BMXBMI lt 18.5 then BMICATF=1;
else if 18.5 le BMXBMI lt 25 then BMICATF=4;
else if 25 le BMXBMI lt 30 then BMICATF=2;
else if BMXBMI ge 30 then BMICATF=3;
The dependent variable should be a continuous variable and will always appear on the left hand side of the equation. The variables on the right hand side of the equation are the independent variables and may be discrete or continuous.
When interactions are included in the model, they are denoted with an asterisk, *, between the two variables. An interaction can occur between a discrete and a continuous variable, or between two discrete variables. An interaction term always will always appear on the right hand side of an equation.
The summary table below provides steps for performing linear regression analyses using SAS Survey procedures.
|
|
| Statements | Explanation | |
|---|---|---|
| PROC SURVEYREG DATA=analysis_data nomcar; | Use the SAS Survey procedure, proc surveyreg, to calculate significance. Use the nomcar option to read all observations. |
|
| STRATA sdmvstra; |
Use the strata statement to specify the strata (sdmvstra) and account for design effects of stratification. |
|
| CLUSTER sdmvpsu; | Use the cluster statement to specify PSU (sdmvpsu) to account for design effects of clustering. |
|
| WEIGHT wtmec4yr; |
Use the weight statement to account for the unequal probability of sampling and non-response. In this example, the MEC weight for 4 years of data (wtmec4yr) is used. |
|
| DOMAIN eligible; | Use the domain statement to restrict the analysis to individuals with complete data for all the variables used in the final multiple regression model. |
|
| MODEL lbdhdl= bmxbmi/CLPARM VADJUST=none; |
Use a model statement to specify the dependent variable for HDL cholesterol (lbdhdl) as a function of the independent variable (BMI category). Body mass index (bmxbmi) is treated as continuous variable. The clparm option requests confidence limits for the parameters. The vadjust option specifies whether or not to use variance adjustment. This model will show the relationship between a unit increase in BMI and cholesterol level. |
|
|
TITLE
'Linear regression model for high density lipoprotein and
selected covariates: NHANES 1999-2002' ; |
Use the title statement to label the output. |
| Statements | Explanation |
|---|---|
|
PROC SURVEYREG |
Use the proc surveyreg procedure to perform linear regressions Use the nomcar option to read all observations. This model will show the relationship between each unit increase in BMI category and cholesterol level. |
| Statements | Explanation |
|---|---|
|
PROC SURVEYREG |
Use the proc surveyreg procedure to perform linear regression. Use the nomcar option to read all observations. This model uses the normal BMI category as a reference category for cholesterol level. Use the class statement to denote the discrete variables included in the model; all other variables are treated as continuous. In this example, bmicatf is treated as a discrete variable. |
Highlights from the output include:
|
|
| Statements | Explanation | |
|---|---|---|
| PROC SURVEYREG DATA=analysis_data nomcar; | Use the SAS Survey procedure, proc surveyreg, to calculate significance. Use the nomcar option to read all observations. |
|
| STRATA sdmvstra; |
Use the strata statement to specify the strata (sdmvstra) and account for design effects of stratification. |
|
| CLUSTER sdmvpsu; | Use the cluster statement to specify PSU (sdmvpsu) to account for design effects of clustering. |
|
| WEIGHT wtmec4yr; |
Use the weight statement to account for the unequal probability of sampling and non-response. In this example, the MEC weight for 4 years of data (wtmec4yr) is used. |
|
| CLASS sex ethn smoker dmdeduc bmicatf; | Use the class statement to denote the discrete variables included in the model; all other variables are treated as continuous. In this example sex, ethnicity (ethn), smoking status (smoker), education (dmdeduc), and BMI (bmicatf) are treated as discrete variables. |
|
| DOMAIN eligible; | Use the domain statement to restrict the analysis to individuals with complete data for all the variables used in the final multiple regression model. |
|
| MODEL lbdhdl= sex ethn ridageyr dmdeduc smoker bmicatf/CLPARM vadjust=none; |
Use a model statement to specify the dependent variable for HDL cholesterol (lbdhdl) as a function of the independent variable (BMI category). The clparm option requests confidence limits for the parameters. The vadjust option specifies whether or not to use variance adjustment. This model will show the relationship between BMI category and cholesterol level. |
|
| ESTIMATE 'Never vs past smoker' smoker 1 -1 0; | Use the estimate statement to test for differences in HDL cholesterol between non-smokers and past smokers. |
|
|
TITLE 'Linear regression model for high density lipoprotein and
selected covariates: NHANES 1999-2002' ; |
Use the title statement to label the output. |
|
In this step, the SAS Survey procedures output is reviewed.