Task 4b: How to Set Up a T-Test in NHANES Using SAS Survey Procedures

In this task, you will use SAS to calculate a t-statistic and assess whether the mean systolic blood pressure in calcium users vs. non-users ages 20 years and older is statistically different.  

 

Step 1: Identify variables

This example uses the demoadv dataset (download at Sample Code and Datasets).  The t-test is used with one continuous variable and one dichotomous variable.  The dataset contains a created variable called anycalsup that has a value of 1 for those who report calcium supplement use, and a value of 2 for those who do not.  A participant was considered not to have any calcium supplement use if the daily average amount of calcium supplement use was zero; otherwise, a participant was considered a supplement user (see Supplement Code under Sample Code and Module 9, Task 4 for more information). A variable called sel is created that defines those individuals 20 years old and older. Blood pressure is measured in the MEC; therefore MEC weights are used in the analysis. The demoadv dataset for this example only includes those with MEC weights (wtmec2yr>0):