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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 1 reply
  • 263 views
  • 0 likes
  • 2 in conversation