The second task is to check the data for skip patterns. To do this, you will use the:
Check the codebook and the appendix containing the data collection forms in the Plan and Operations Report to determine if a skip pattern affects the variables in your analysis. The Plan and Operation Report link is the first bullet under Data and Documentation/Codebook Files heading on the NHANES II page. See the Locate Variables module Task 1 for more information on how to locate background information on variables in the documentation.

After you have used the codebook to discover if a skip pattern affects variables in your analysis, you will use cross tabulations obtained by the SAS proc freq procedure to determine the effect of skip patterns.
|
Statement |
Explanation |
|---|---|
|
Proc freq data=demo2_nh2; |
Use the proc freq procedure to determine the frequency of each value of the variables listed. |
| where n2ah0047>=20; |
Use the where statement to select participants who were age 20 years and older. |
|
table n2ah1059*n2ah1060 n2ah1060*(n2ah1067 n2ah1068 n2ah1069) n2ah1068*n2ah1069/list missing; title 'Check skip patterns for BP questions'; run; |
Use the table statement to list the variables to be included in the output frequency table and the cross tabulation frequency table for the skip patterns. Use the list missing option to display missing values. Note that a star (*) indicates that a crosstab will be constructed with n2ah1059 as the row variable and n2ah1060 as the column variable. The syntax for a cross-tabulation is row variable(s)*column variable(s) and designates that the variable listed before the star will be the row variable and the variable listed after the star will be the column variable. |
Highlighted items from the proc freq output for skip patterns:
To recode the missing data due to skip patterns, you can either:
Using the SAS if, then, and else statements you can either recode the variable directly or create a new variable (derived from the values of the variables in the skip pattern sequence).
| Statements | Explanation |
|---|---|
|
Data
temp3_nh2; |
Use data and set statements to refer to your analytic dataset. |
|
If n2ah1059=1 then n2ah1059=1; Else if n2ah1060=1 then n2ah1059=1; |
Use the if, then, and else statements to directly recode n2ah1059 values based on the n2ah1060 values.
|
|
Proc
freq
data=temp3_nh2; |
Use the proc freq procedure to determine the frequency of each value of the variables listed; use the data statement to refer to your analytic dataset; use the where statement to select participants who were age 20 years and older (n2ah0047>=20); use the table statement to indicate variables of interest for the output. |
| Statements | Explanation |
|---|---|
|
Data
demo3_nh2; |
Use the data and set statements to refer to your analytic dataset. |
|
If
n2ah1059=1
or
n2ah1060=1
then
diagHTN=1; Else if n2ah1059=. and n2ah1060=. then diagHTN=.; If n2ah1069=1 then HTNMED=1; Else if n2ah1059 in (1,2) and n2ah1069 <8 then HTNMED=2; If n2ah0625=1 then CIGSMOK=1; Else if n2ah0626=1 and n2ah0625=2 then CIGSMOK=2; else if n2ah0626=2 then CIGSMOK=3; |
Use the if, then, and else statements to create a new, derived variable (diagHTN) based on the n2ah1059 and n2ah1060 values.
|
|
Proc
freq
data=demo3_nh2; |
Use the proc freq and table statements to check the derived variable (diagHTN) against the original variables (n2ah1059 and n2ah1060); use the data statement to refer to your analytic dataset; use the where statement to select participants who were age 20 years and older (n2ah0047>=20); use the table statement to indicate variables of interest for the output. |
Highlighted items from the recode output for skip patterns: