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*.

IMPORTANT NOTE

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, |

strata sdmvstra; |
Use the |

cluster sdmvpsu; |
Use the |

class riagendr; |
Use the |

weight wtmec4yr; |
Use the |

domain sel sel*riagendr; |
Use the
WARNING
When using . |

var bpxsar; |
Use the |

ods output domain(match_all)=domain; |
Use the |

set domain domain1; if sel= 1 ; |
all;
Use the |

var riagendr n mean stderr; title "Mean systolic blood pressure: NHANES 1999-2002" ; ; |
;
Use the |

- 9,056 respondents had information
on systolic blood pressure (
*SBP*). - The results indicate the mean SBP was 124 for males and 122 for females.

A t-test is used to test whether the mean SBP between males and females obtained in the previous step is statistically significant different.

Request the t-test from the SAS Proc Surveyreg procedure and follow the steps in the summary table below.

IMPORTANT NOTE

Statements | Explanation |
---|---|

PROC SURVEYREG DATA=analysis_data nomcar; | Use the SAS Survey procedure, |

STRATA sdmvstra; |
Use the |

CLUSTER sdmvpsu; | Use the |

CLASS riagendr; | Use the |

WEIGHT wtmec4yr; |
Use the |

DOMAIN sel; | Use the
WARNING
When using |

MODEL bpxsar = riagendr/ vadjust=none; |
Use a |

TITLE
'Significance test for difference between mean systolic
blood pressure for males and females NHANES 1999-2002' ; |
Use the |

- 9,056 respondents had information on systolic blood pressure
- The number of degrees of freedom in this example is equal to 29.
- The t-statistic, with 29 degrees of freedom, is equal to 2.64. The p-value of 0.0132 indicates that the probability of obtaining a value of the t-statistic whose absolute value is greater than or equal to 2.64 is 0.0132. Therefore, the null hypothesis is rejected at the 0.05 level.