Hi everyone, I’m trying to create a PCA biplot using PROC SGPLOT. My goal is to display both: The distribution of sample groups (using their scores), and The variable vectors (representing the loadings or contributions of each variable). I know that PROC SGPLOT provides both the SCATTER and VECTOR statements. I extracted the eigenvalues (scores) and plotted them successfully using SCATTER. However, I’m having trouble extracting the eigenvectors (loadings) and plotting them as vectors on the same graph. I generated some fictitious data for testing purposes and tried different approaches, but I haven’t been able to produce the desired biplot with both scores and loadings. I’m attaching the graphs generated by PROC PRINCOMP. While these show the component pattern plot, I don’t know how to extract both the scores and loadings correctly for use with PROC SGPLOT. That’s why I tried using SGPLOT directly, but without success so far. I’d appreciate any help or suggestions from anyone with experience in this area. Thank you! data dados_ficticios; input grupo $ var1 var2 var3 var4; datalines; A 5 7 8 6 A 6 8 9 5 A 5 7 7 6 B 8 5 6 7 B 7 4 5 8 B 8 6 7 6 C 3 9 8 4 C 2 8 7 5 C 3 9 8 4 ; run; proc princomp data=dados_ficticios out=escores outstat=autovetores n=2 plots=all; var var1 var2 var3 var4; id grupo; run; proc print data=escores;run; proc print data=autovetores;run;
... View more