Support.sas.com provides this syntax for creating a prediction ellipse. The output dataset includes only the correlation results for the dataset. Is there any way to get information for the individual cases, such as labeling them in the graph or having the output include values for the individual cases?
I’ve tried adding the ID option to this code but was unsuccessful.
Scatter Plot with Prediction Ellipses
ods graphics on; proc corr data=fish1 plots=scatter(alpha=.20 .30); var Height Width; run; ods graphics off;
If the data doesn’t have to be printed on the graph itself, you can get observation level data shown as a mouse-over tip by using the
imagemap=onods option. This only applies to the html destination, though. By default, your Height and Weight and observation number values will be shown in the tip. The ID statment just lets you add more.Update: Here’s an easy way to get some data values printed on the plot. If you change
datalabel=weighttodatalabel=heightit will print the height values for each observation instead. This uses the sgplot proc instead of the plots=scatter statement inside proc corr. Because of this the number of observations and the correlation are not printed on the plot but I’m sure you could find a way to add it if you needed.