Dear all,
I would like some help with the use of supplementary variables in a PCA.
I have 10 variables (A1-A5 and B1-B5 ) that organise neatly into two factors. I would then like to plot on the graph representing the two factors, a third variable.
In fact, I. have two separate variables. One (CATEGORY) is dichotomous, with values A or B. The second one (NAME) is nested within the previous ones and has values LIT1-LIT50 and POP1-POP50.
I include the data file.
An example of what i would like appears in the graph below.
Many thanks in advance for any suggestion you may have.
Simply concatenate your labels?
data temp;
set sasforum.export;
length label $12;
label = catx("-", category, name);
run;
proc princomp data=temp n=2 out=graph plots=score(ncomp=2);
var a1-a5 b1-b5;
id label;
run;
or use the out=graph dataset (which contains new variables Prin1 and Prin2) to create a fancier graph with proc sgplot.
Simply concatenate your labels?
data temp;
set sasforum.export;
length label $12;
label = catx("-", category, name);
run;
proc princomp data=temp n=2 out=graph plots=score(ncomp=2);
var a1-a5 b1-b5;
id label;
run;
or use the out=graph dataset (which contains new variables Prin1 and Prin2) to create a fancier graph with proc sgplot.
That is perfect! And using sgplot indeed gives me a chance to make a better graph.
Thank you very much, really appreciated.
Eman
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.