- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That is perfect! And using sgplot indeed gives me a chance to make a better graph.
Thank you very much, really appreciated.
Eman