In this task, you will use SAS Survey Procedures to calculate a t-statistic and assess whether the mean systolic blood pressures (SBP) in males and females age 20 years and older are statistically different.
In order to subset the data in SAS Survey Procedures, you will need to create a variable for the population of interest. In this example, the sel variable is set to 1 if the sample person is 20 years or older, and 2 if the sample person is younger than 20 years. Then this variable is used in the domain statement to specify the population of interest (those 20 years and older).
if ridageyr GE 20 then sel = 1;
else sel = 2;
Follow the explanations in the summary table below to produce the mean SBP using the SAS Survey procedure proc surveymeans.
These programs use variable formats listed in the Tutorial Formats page. You may need to format the variables in your dataset the same way to reproduce results presented in the tutorial.
Statements | Explanation |
---|---|
data=analysis_data nobs mean stderr; |
Use the SAS Survey procedure, proc surveymeans, to count the number of observations (nobs) and calculate means (mean) and standard errors (stderr), and specify the dataset (analysis_Data). |
strata sdmvstra; |