/* x8_4.sas */ /* Purpose: */ title1 'Example 8.4'; data a; input x1 x2 x3 x4 x5 x6 x7 box$; cards; 3.76 3.66 0.54 5.275 9.768 13.741 4.782 a 8.59 4.99 1.34 10.022 7.500 10.162 2.130 b 6.22 6.14 4.52 9.842 2.175 2.732 1.089 c 7.57 7.28 7.07 12.662 1.791 2.101 0.822 d 9.03 7.08 2.59 11.762 4.539 6.217 1.276 e 5.51 3.98 1.30 6.924 5.326 7.304 2.403 f 3.27 0.62 0.44 3.357 7.629 8.838 8.389 g 8.74 7.00 3.31 11.675 3.529 4.757 1.119 h 9.64 9.49 1.03 13.567 13.133 18.519 2.354 i 9.73 1.33 1.00 9.871 9.871 11.064 3.704 j 8.59 2.98 1.17 9.170 7.851 9.909 2.616 k 7.12 5.49 3.68 9.716 2.642 3.430 1.189 l 4.69 3.01 2.17 5.983 2.760 3.554 2.013 m 5.51 1.34 1.27 5.808 4.566 5.382 3.427 n 1.66 1.61 1.57 2.799 1.783 2.087 3.716 o 5.90 5.76 1.55 8.388 5.395 7.497 1.973 p 9.84 9.27 1.51 13.604 9.017 12.668 1.745 q 8.39 4.92 2.54 10.053 3.956 5.237 1.432 r 4.94 4.38 1.03 6.678 6.494 9.059 2.807 s 7.23 2.30 1.77 7.790 4.393 5.374 2.274 t 9.46 7.31 1.04 11.999 11.579 16.182 2.415 u 9.55 5.35 4.25 11.742 2.766 3.509 1.054 v 4.94 4.52 4.50 8.067 1.793 2.103 1.292 w 8.21 3.08 2.42 9.097 3.753 4.657 1.719 x 9.41 6.44 5.11 12.495 2.446 3.103 0.914 y ; proc print data=a; title2 'List of data.'; proc factor data=a simple nfactors=2 rotate=varimax score out=b; var x1-x7; title2 'Principal factor analysis - 2 factors, varimax rotation + scores.'; proc print data=b; var x1 x2 x3 factor1 factor2; title2 'List of data (X1 X2 X3) and factor scores (FACTOR1 FACTOR2).'; title3 'Note: SAS does not compute the scores as in the example in the book.'; proc plot data=b; plot factor2*factor1=box; title2 'Plot of boxes using transformed variables.'; run;