|
|
|
|
|
|
||
|
|
|
Research Problems: |
1. The Intensive Care Unit Study |
We illustrate how to read data into SAS using as an example data from the Intensive Care Study (icu.dat). These data are stored as an ASCII data file in a rectangular format with columns representing variables and rows representing subjects. Each column is separated by one or more blanks. A code book (icu.txt) describes the variables representing the columns. To follow this example, you should
Identifying the Columns
The data files stored as ASCII files with rows corresponding to subjects, and columns corresponding to variables. The values are in columns that line up. To see what columns correspond to the variables, use lec3sm4.sas.
Reading a Subset of Variables
The variable list (icu.txt) includes
- id
- age
- sex
- race
- systolic blood pressure (sys).
Assume we are only interested in these four variables. Using the results of lec3sm4.sas, we identify columns when reading these variables using lec3sm5.sas. This program makes use of :
- INFILE FIRSTOBS= Use to skip over the first set of lines.
- PROC CONTENTS Use to list the variables and data set information.
Checking: It is a good policy to print data that you have read into SAS to make sure that it appears to match the ASCII data in the file. We do so in lec3sm6.sas. Comparing these results with the data in icu.dat , we find that the variable ID was not specified correctly. This is also evident in the codesheet icu.txt . The program lec3sm7.sas corrects this error in the column specification.
|
|
Produced and maintained by the
Dept
of BioEpi at UMASS |