Printing Raw Data with PROC PRINT

PROC PRINT can be used to create a printout of your raw data as they exist in the computer’s internal memory. The output of PROC PRINT shows each participant’s value on each of the requested variables. You can use this procedure with both quantitative variables and classification variables. The general form is:

PROC PRINT   DATA=dataset-name;
   VAR  variable-list  ;
RUN;

In the variable list, you can request any variable that is specified in the INPUT statement, as well as any new variable that is created from existing variables. If you do not include the VAR statement, then all existing variables will be printed. The program presented earlier in this chapter included the following PROC PRINT statements:

PROC PRINT   DATA=D1;
   VAR RESNEEDY SEX CLASS;
   RUN;

These statements produce Output 5.3.

Output 5.3. Results of the PRINT Procedure
Obs    RESNEEDY    SEX    CLASS

 1        5        F       1
 2        4        M       1
 3        5        F       1
 4        .        F       1
 5        4        F       1
 6        4        F       2
 7        1        F       2
 8        4        F       2
 9        1        F       3
10        5        M       .
11        4        F       4
12        4        M       4
13        3        F       .
14        4        F       5

The first column of output is headed “Obs” for “observation.” This variable is created by SAS to give an observation number to each participant. The second column provides the raw data for the RESNEEDY variable, the third column displays the SEX variable, and the last displays the CLASS variable. The output shows that observation 1 (participant 1) provided a value of 5 on RESNEEDY, was a female, and provided a value of 1 on the CLASS variable. Notice that SAS prints periods where there are missing values.

PROC PRINT is helpful for verifying that your data are entered correctly and that SAS is reading the data correctly. It is particularly useful for studies with a large number of variables; for instance, when you use a questionnaire with a large number of questions. In these situations, it is often difficult to visually inspect the data as they exist in the SAS program file. In the SAS program file, participant responses are often entered immediately adjacent to each other, making it difficult to determine just which number represents question 24 as opposed to question 25. When the data are printed using PROC PRINT, however, the variables are separated from each other and are clearly labeled with their variable names.

After entering questionnaire data, you should compare the results of PROC PRINT with several of the questionnaires as they were actually completed by participants. Verify that participants’ responses on the PROC PRINT output correspond to the original responses on the questionnaire. If not, it is likely that mistakes were made in either entering the data or in writing the SAS program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.138.97