BookmarkSubscribeRSS Feed
trungdungtran
Obsidian | Level 7

Hi all,

 

I am using Proc PRINCOMP. SAS says that "You can use ODS Graphics to display the scree plot, component pattern plot, component pattern profile plot, matrix plot of component scores, and component score plots. These plots are especially valuable tools in exploratory data analysis.". I think that before plotting these plots, SAS should store the data sets somewhere.

 

I would like to save these data sets but I cannot do. Do you have any idea how to get them out?

 

In the attachment, I include two plots from the output when specify:

 

Ods graphics on;
Proc princomp data=ind_g1 n=2 plots=all out=scores_ind_corr_g1;
	Var Vraag_11-Vraag_24;
Run;
Ods graphics off;

 

Thank you,

Trung Dung.

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

To get the datasets behind the scenes out you need to use:

ods output wantdataset=objdataset;

proc printcomp...

The objdataset is the one from:

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_princomp_se...

 

The wantdataset is a name you give it.

 

That stores the data, graphics objects are on the next page:

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_princomp_se...

 

To create nice output it should be as simple as redirecting ods:

ods rtf file="temp.rtf";

proc princomp...

ods rtf close;
PGStats
Opal | Level 21

@RW9, that should be

 

ods output objdataset=wantdataset;

PG
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yep, I have only ever seen it used as:

ods output meanscalc=meanscalc;

 

I.e. both the same, so always forget which is which.

Rick_SAS
SAS Super FREQ

For information about how to store any table or graph to a data set, see

ODS OUTPUT: Store any statistic created by any SAS procedure

For the specific case of graphs, see

How to get data values out of ODS graphics

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 867 views
  • 0 likes
  • 4 in conversation