Here are the steps to keep NHANES III data:
|
Statements |
Explanation |
|
|---|---|---|
| libname NH3 "C:\NHANES III\DATA"; | Use the libname statement to refer to the data folder. |
|
| data lab; |
Use the data step to create a dataset for your laboratory data (lab). |
|
| set NH3.lab (keep=SEQN TCP TGP); |
Use the set statement to bring in the laboratory file. Use the keep statement to select the variables of interest.
|
|
| data exam; |
Use the data step to create a dataset for your examination data (exam). |
|
|
set
NH3.exam (keep=SEQN
PEP6G1 PEP6H1 PEP6I1 PEPMNK1R PEP6G3 PEP6H3 PEP6I3 PEPMNK5R BMPBMI MAPF12R MYPC17); |
Use the set statement to bring in the examination file. Use the keep statement to select the variables of interest. |
|
| data adult; |
Use the data step to create a dataset for your adult questionnaire data (adult). |
|
|
set
NH3.adult (keep=SEQN
HFA8R HAR1 HAR3 HAE1 HAE2 HAE3 HAE5A HAE6 HAE7 HAE9D HAC1C HAF10
HAC1D HSAGEIR HSAGEU HSSEX DMARETHN SDPPSU6 SDPSTRA6 WTPFEX6 DMPSTAT SDPPHASE); |
Use the set statement to bring in the adult questionnaire file. Use the keep statement to select the variables of interest. |
|
| data youth; |
Use the data step to create the dataset for your youth questionnaire data (youth). |
|
| set NH3.youth (keep=SEQN SDPPSU6 SDPSTRA6 WTPFEX6 HSAGEU HSAGEIR DMARETHN DMPSTAT SDPPHASE); |
Use the set statement to bring in the laboratory file. Use the keep statement to select the variables of interest. |
After keeping the variables, it is a good idea to check the contents again to make sure that the datasets were kept with the correct variables in them and with the total number of variables expected.
Highlighted results of the proc contents procedure on the new dataset are: