APPLE ORCHARDS with 5 covariates - YOURNAME 1 THE DATA AS SAS SEES IT 01:01 Monday, October 27, 2008 farm Nat KK PP Shade Water A 20.0 38 2488 2.42 216 B 11.1 13 2998 1.62 321 C 19.8 31 3835 2.79 376 D 13.9 19 2360 1.65 265 E 17.0 24 233 0.86 18 F 16.9 26 3922 2.70 369 G 11.6 16 4343 2.40 453 H 14.3 22 3110 2.05 267 I 10.5 13 2869 1.63 286 J 18.2 31 2335 2.17 252 K 8.3 8 1784 0.84 185 L 20.4 36 2601 2.47 275 M 8.7 18 2124 1.27 201 N 7.5 4 4408 1.85 411 APPLE ORCHARDS with 5 covariates - YOURNAME 2 PRINCIPAL COMPONENTS ANALYSIS USING PROC PRINCOMP 01:01 Monday, October 27, 2008 The PRINCOMP Procedure Observations 14 Variables 5 Simple Statistics Nat KK PP Shade Water Mean 14.15714286 21.35714286 2815.000000 1.908571429 278.2142857 StD 4.59643914 10.27024936 1111.444936 0.631857544 109.2310033 Correlation Matrix Nat KK PP Shade Water Nat Sodium 1.0000 0.9531 -.1361 0.5980 -.1455 KK Potassium 0.9531 1.0000 -.1719 0.5796 -.1916 PP Phosphorus -.1361 -.1719 1.0000 0.6968 0.9788 Shade Shade 0.5980 0.5796 0.6968 1.0000 0.6740 Water Water -.1455 -.1916 0.9788 0.6740 1.0000 Eigenvalues of the Correlation Matrix Eigenvalue Difference Proportion Cumulative 1 2.64995587 0.37257225 0.5300 0.5300 2 2.27738362 2.22807114 0.4555 0.9855 3 0.04931249 0.02801055 0.0099 0.9953 4 0.02130194 0.01925585 0.0043 0.9996 5 0.00204608 0.0004 1.0000 Eigenvectors Prin1 Prin2 Prin3 Prin4 Prin5 Nat Sodium 0.300110 0.567769 0.737532 -.119502 0.171284 KK Potassium 0.280688 0.581949 -.605548 0.272208 0.376514 PP Phosphorus 0.485171 -.402078 -.100123 -.573749 0.513546 Shade Shade 0.607029 0.093933 -.176799 -.188920 -.745482 Water Water 0.476731 -.410467 0.219260 0.739421 0.097087 APPLE ORCHARDS with 5 covariates - YOURNAME 3 PRINCIPAL COMPONENTS ANALYSIS USING PROC PRINCOMP THE 5 PC DATA COLUMNS 01:01 Monday, October 27, 2008 (CHECK WITH PROC IML OUTPUT BELOW) Obs Prin1 Prin2 Prin3 Prin4 Prin5 1 0.91340 2.09289 -0.28229 -0.11606 0.018084 2 -0.43862 -1.12106 0.15235 0.13942 0.042747 3 2.35080 0.63800 0.19465 -0.01927 0.082067 4 -0.58591 0.01049 0.18453 0.16695 -0.012907 5 -3.01231 2.25693 0.30399 -0.11895 0.015654 6 1.94577 -0.02208 0.02743 -0.14178 -0.069142 7 1.58859 -1.75595 -0.01875 0.17196 -0.010117 8 0.24260 0.01052 -0.10364 -0.25716 -0.011632 9 -0.67726 -1.01549 -0.00536 -0.01830 -0.082123 10 0.45472 1.35681 -0.00238 0.14264 -0.049357 11 -2.63094 -0.91596 0.05250 0.01897 -0.006444 12 1.23972 1.77382 -0.00592 0.14664 0.005329 13 -1.70017 -0.41911 -0.59176 0.07785 0.039062 14 0.30961 -2.88981 0.09464 -0.19292 0.038778 APPLE ORCHARDS with 5 covariates - YOURNAME 4 MEANS AND VARIANCES OF PRIN1-PRIN5 01:01 Monday, October 27, 2008 Note that the means are zero and the variances are the same as the eigenvalues in the Eigenvalue table, exactly as predicted. The MEANS Procedure Variable Mean Variance ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Prin1 -0.0000 2.6500 Prin2 -0.0000 2.2774 Prin3 -0.0000 0.0493 Prin4 -0.0000 0.0213 Prin5 -0.0000 0.0020 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ APPLE ORCHARDS with 5 covariates - YOURNAME 5 CORRELATIONS WITHIN PRIN1-PRIN5 01:01 Monday, October 27, 2008 Prin1-Prin5 are uncorrelated, as they should be. The CORR Procedure 5 Variables: Prin1 Prin2 Prin3 Prin4 Prin5 Simple Statistics Variable N Mean Std Dev Sum Prin1 14 0 1.62787 0 Prin2 14 0 1.50910 0 Prin3 14 0 0.22206 0 Prin4 14 0 0.14595 0 Prin5 14 0 0.04523 0 Simple Statistics Variable Minimum Maximum Prin1 -3.01231 2.35080 Prin2 -2.88981 2.25693 Prin3 -0.59176 0.30399 Prin4 -0.25716 0.17196 Prin5 -0.08212 0.08207 Pearson Correlation Coefficients, N = 14 Prob > |r| under H0: Rho=0 Prin1 Prin2 Prin3 Prin4 Prin5 Prin1 1.00000 0.00000 0.00000 0.00000 0.00000 1.0000 1.0000 1.0000 1.0000 Prin2 0.00000 1.00000 0.00000 0.00000 0.00000 1.0000 1.0000 1.0000 1.0000 Prin3 0.00000 0.00000 1.00000 0.00000 0.00000 1.0000 1.0000 1.0000 1.0000 Prin4 0.00000 0.00000 0.00000 1.00000 0.00000 1.0000 1.0000 1.0000 1.0000 Prin5 0.00000 0.00000 0.00000 0.00000 1.00000 1.0000 1.0000 1.0000 1.0000 APPLE ORCHARDS with 5 covariates - YOURNAME 6 DATA IN A PRIN2*PRIN1 plot: 01:01 Monday, October 27, 2008 THIS SHOWS THE DISTRIBUTION of the N original farms (observations) in (Prin1,Prin2) coordinates. THIS CAN ALSO BE USEFUL TO DETECT OUTLIERS. Plot of Prin2*Prin1. Symbol is value of farm. Prin2 ‚ ‚ 3 ˆ ‚ ‚ ‚ ‚E ‚ A 2 ˆ ‚ L ‚ ‚ ‚ J ‚ 1 ˆ ‚ ‚ C ‚ ‚ ‚ 0 ˆ D H F ‚ ‚ ‚ M ‚ ‚ K -1 ˆ I ‚ B ‚ ‚ ‚ ‚ G -2 ˆ ‚ ‚ ‚ ‚ ‚ N -3 ˆ ‚ Šˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒˆƒ -3 -2 -1 0 1 2 3 Prin1 APPLE ORCHARDS with 5 covariates - YOURNAME 7 DATA IN A PRIN2*PRIN1 plot: 01:01 Monday, October 27, 2008 DATA SORTED BY THE FIRST PRINCIPAL COMPONENT EVERYTHING IS POSITIVELY CORRELATED WITH PRIN1 Obs farm Prin1 Nat KK PP Shade Water 1 C 2.35080 19.8 31 3835 2.79 376 2 F 1.94577 16.9 26 3922 2.70 369 3 G 1.58859 11.6 16 4343 2.40 453 4 L 1.23972 20.4 36 2601 2.47 275 5 A 0.91340 20.0 38 2488 2.42 216 6 J 0.45472 18.2 31 2335 2.17 252 7 N 0.30961 7.5 4 4408 1.85 411 8 H 0.24260 14.3 22 3110 2.05 267 9 B -0.43862 11.1 13 2998 1.62 321 10 D -0.58591 13.9 19 2360 1.65 265 11 I -0.67726 10.5 13 2869 1.63 286 12 M -1.70017 8.7 18 2124 1.27 201 13 K -2.63094 8.3 8 1784 0.84 185 14 E -3.01231 17.0 24 233 0.86 18 APPLE ORCHARDS with 5 covariates - YOURNAME 8 DATA IN A PRIN2*PRIN1 plot: 01:01 Monday, October 27, 2008 DATA SORTED BY THE SECOND PRINCIPAL COMPONENT (NA,K) ARE POSITIVELY CORRELATED WITH PRIN2, (P,WATER) ARE NEGATIVELY CORRELATED, SHADE APPEARS UNCORRELATED Obs farm Prin2 Nat KK PP Shade Water 1 E 2.25693 17.0 24 233 0.86 18 2 A 2.09289 20.0 38 2488 2.42 216 3 L 1.77382 20.4 36 2601 2.47 275 4 J 1.35681 18.2 31 2335 2.17 252 5 C 0.63800 19.8 31 3835 2.79 376 6 H 0.01052 14.3 22 3110 2.05 267 7 D 0.01049 13.9 19 2360 1.65 265 8 F -0.02208 16.9 26 3922 2.70 369 9 M -0.41911 8.7 18 2124 1.27 201 10 K -0.91596 8.3 8 1784 0.84 185 11 I -1.01549 10.5 13 2869 1.63 286 12 B -1.12106 11.1 13 2998 1.62 321 13 G -1.75595 11.6 16 4343 2.40 453 14 N -2.88981 7.5 4 4408 1.85 411 APPLE ORCHARDS with 5 covariates - YOURNAME 9 PROC IML: REDOING THE PRINCIPAL COMPONENTS ANALYSIS 01:01 Monday, October 27, 2008 The covariance matrix of the covariates: NAMES COVAR Sodium 21.13 44.99 -695.05 1.74 -73.04 Potassium 44.99 105.48 -1962.77 3.76 -214.93 Phosphorus -695.05 -1962.77 1235309.85 489.37 118826.38 Shade 1.74 3.76 489.37 0.40 46.52 Water -73.04 -214.93 118826.38 46.52 11931.41 The CORRELATION MATRIX of the covariates: NAMES CORR Sodium 1.0000 0.9531 -0.1361 0.5980 -0.1455 Potassium 0.9531 1.0000 -0.1719 0.5796 -0.1916 Phosphorus -0.1361 -0.1719 1.0000 0.6968 0.9788 Shade 0.5980 0.5796 0.6968 1.0000 0.6740 Water -0.1455 -0.1916 0.9788 0.6740 1.0000 The eigenvalues and normalized eigenvectors of CORR: THE `FACTOR LOADINGS' are the COLUMNS of EGVECS These define the `Principal Component factors' in terms of the original variables. The `FACTOR WEIGHTINGS' are the rows of EGVECS These reverse the transformation. EGVALS NAMES EGVECS 2.6500 Sodium 0.3001 0.5678 0.7375 -0.1195 0.1713 2.2774 Potassium 0.2807 0.5819 -0.6055 0.2722 0.3765 0.0493 Phosphorus 0.4852 -0.4021 -0.1001 -0.5737 0.5135 0.0213 Shade 0.6070 0.0939 -0.1768 -0.1889 -0.7455 0.0020 Water 0.4767 -0.4105 0.2193 0.7394 0.0971 The PC data columns are FARM YY A 0.91340 2.09289 -0.28229 -0.11606 0.01808 B -0.43862 -1.12106 0.15235 0.13942 0.04275 C 2.35080 0.63800 0.19465 -0.01927 0.08207 D -0.58591 0.01049 0.18453 0.16695 -0.01291 E -3.01231 2.25693 0.30399 -0.11895 0.01565 F 1.94577 -0.02208 0.02743 -0.14178 -0.06914 G 1.58859 -1.75595 -0.01875 0.17196 -0.01012 H 0.24260 0.01052 -0.10364 -0.25716 -0.01163 I -0.67726 -1.01549 -0.00536 -0.01830 -0.08212 J 0.45472 1.35681 -0.00238 0.14264 -0.04936 K -2.63094 -0.91596 0.05250 0.01897 -0.00644 L 1.23972 1.77382 -0.00592 0.14664 0.00533 M -1.70017 -0.41911 -0.59176 0.07785 0.03906 N 0.30961 -2.88981 0.09464 -0.19292 0.03878 The covariance matrix for Y (PC data columns or PC scores) is APPLE ORCHARDS with 5 covariates - YOURNAME 10 PROC IML: REDOING THE PRINCIPAL COMPONENTS ANALYSIS 01:01 Monday, October 27, 2008 PRNAMES COVPCDAT PRIN1 2.6500 -0.0000 0.0000 0.0000 0.0000 PRIN2 -0.0000 2.2774 0.0000 0.0000 -0.0000 PRIN3 0.0000 0.0000 0.0493 0.0000 0.0000 PRIN4 0.0000 0.0000 0.0000 0.0213 0.0000 PRIN5 0.0000 -0.0000 0.0000 0.0000 0.0020 APPLE ORCHARDS with 5 covariates - YOURNAME 11 BACK IN REGULAR SAS (NOT PROC IML): 01:01 Monday, October 27, 2008 SCREE PLOT FOR EIGENVALUES FOR APPLE COVARIATES Plot of EGVALS*EVAL. Symbol is value of EVAL. EGVALS ‚ ‚ ‚ ‚ ‚ ‚ ‚ 3 ˆ ‚ ‚ 1 ‚ ‚ ‚ 2 ‚ 2 ˆ ‚ ‚ ‚ ‚ ‚ ‚ 1 ˆ ‚ ‚ ‚ ‚ ‚ ‚ 0 ˆ 3 4 5 ‚ Šƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒ 1 2 3 4 5 EVAL