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!
@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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.