Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Special SAS Data Sets

Example A.2: Creating a TYPE=CORR Data Set in a DATA Step

This example creates a TYPE=CORR data set by reading a correlation matrix in a DATA step. Output A.2.1 shows the resulting data set.

   title 'Five Socioeconomic Variables';
   data datacorr(type=corr);
      infile cards missover;
      _type_='corr';
      input _name_ $ pop school employ services house;
      datalines;
   POP        1.00000
   SCHOOL     0.00975   1.00000
   EMPLOY     0.97245   0.15428   1.00000
   SERVICES   0.43887   0.69141   0.51472   1.00000
   HOUSE      0.02241   0.86307   0.12193   0.77765   1.00000
   ;
   proc print;
   run;

Output A.2.1: A TYPE=CORR Data Set Created by a DATA Step
 
Five Socioeconomic Variables

Obs _type_ _name_ pop school employ services house
1 corr POP 1.00000 . . . .
2 corr SCHOOL 0.00975 1.00000 . . .
3 corr EMPLOY 0.97245 0.15428 1.00000 . .
4 corr SERVICES 0.43887 0.69141 0.51472 1.00000 .
5 corr HOUSE 0.02241 0.86307 0.12193 0.77765 1

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.