The second task is to check the data for skip patterns. To do this, you will use the:

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 presence of skip patterns.
|
Statement |
Explanation |
|---|---|
|
Proc freq data=demo2_nh3; |
Use the proc freq procedure to determine the frequency of each value of the variables listed. |
| where hsageu=2 and hsageir>=20 and dmpstat=2; |
Use the where statement to select participants who were age 20 years and older, and who had both the home interview and the MEC exam. |
|
table hae2 hae3 hae5a hae2*(hae3 hae5a) hae6 hae7 hae9d hae6*(hae7 hae9d) har1 har3 har1*har3 /list missing; title 'Check skip patterns for BP, cholesterol, and smoking 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. Note that a star (*) indicates that a crosstab will be constructed with hae2 as the row variable and hae3 and hae5 as the column variables, and similarly for variables hae6 with hae7 and hae9d, and har1 with har3. |
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_nh3; |
Use data and set statements to refer to your analytic dataset. |
|
If hae3=1 then hae3=1; Else if hae2 in (1,2) and hae3 <8 then hae3=2; Else hae3=.; |
Use the if, then, and else statements to directly recode hae3 values based on the hae2 values.
|
|
Proc
freq
data=temp3_nh3; |
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 and who had both the home interview and the MEC exam (hsageu=2 and hsageir>=20 and dmpstat=2); use the table statement to indicate variables of interest for the output. |
| Statements | Explanation |
|---|---|
|
Data
demo3_nh3; |
Use the data and set statements to refer to your analytic dataset. |
|
If
hae3=1
then
diagHTN=1; If hae5a=1 then HTNMED=1; Else if hae2 in (1,2) and hae5a <8 then HTNMED=2; If hae7=1 then diagCHOL=1; Else if hae6 in (1,2) and hae7 <8 then diagCHOL=2; If hae9d=1 then CHOLMED=1; Else if hae6 in (1,2) and hae9d <8 then CHOLMED=2; If har3=1 then CIGSMOK=1; Else if har1=1 and har3=2 then CIGSMOK=2; else if har1=2 then CIGSMOK=3; |
Use the if, then, and else statements to create a new, derived variable (diagHTN) based on the hae3 and hae2 values.
|
|
Proc
freq
data=demo3_nh3; |
Use the proc freq and table statements check the derived variable (diagHTN) against the original variables (hae2 and hae3); use the data statement to refer to your analytic dataset; use the where statement to select participants who were age 20 years and older and who had both the home interview and the MEC exam (hsageu=2 and hsageir>=20 and dmpstat=2); use the table statement to indicate variables of interest for the output. |
Highlighted items from the recode output for skip patterns: