BookmarkSubscribeRSS Feed
SAS_Timber
Calcite | Level 5

Hi users and members, is it possible to get the function of a prediction ellipse or at least the length, height and centre? If yes, then how do i add this to my code?

 

Code: 

/* 95% prediction ellipse */
proc sgplot data=combined_values;
scatter x=new_x y=new_y / markerattrs=(symbol=circlefilled);
ellipse x=new_x y=new_y / alpha=0.05 lineattrs=(thickness=2 color=red) type=prediction;
title "diagram";
xaxis label="x-Werte" min=0 max=&max_val;
yaxis label="y-Werte" min=0 max=&max_val;
run;

 

thanks for your help!

1 REPLY 1
PaigeMiller
Diamond | Level 26

@Rick_SAS has the answer!

https://blogs.sas.com/content/iml/2014/07/23/prediction-ellipses-from-covariance.html

 

Why do you need this prediction formula, what would you do with it if you had it? If you want to determine if additional points (not the ones used to create the ellipse) are within the ellipse, you can just add these additional points to the plot. Example:

 

data additional;
    height1=60; weight1=80; output;
    height1=70; weight1=95; output;
    height1=80; weight1=50; output;
run;

data class;
    set sashelp.class additional;
run;

proc sgplot data=class;
scatter x=height y=weight / markerattrs=(symbol=circlefilled);
ellipse x=height y=weight / alpha=0.05 lineattrs=(thickness=2 color=red) type=predicted;
scatter x=height1 y=weight1 / markerattrs=(symbol=plus);
run;

--
Paige Miller

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 469 views
  • 0 likes
  • 2 in conversation