Hi SAS Forus,
I have a regression line and it only creates this for the x data that I have. How do I get to project beyond the x data?
proc sgplot data=input;
reg x=months y=change_height / clm cli;
series x=months y=change_height /group=ani markerattrs=(symbol=CircleFilled);
scatter x=months y=change_height /group=ani markerattrs=(symbol=CircleFilled);
xaxis max=20;
yaxis min=-20 max=20;
refline -10 10 / axis=y;
run;
Would this be easier to implement with proc reg?
Thanks!
What @ballardw is referring to (I think) is the "Missing Response Trick", at least that's what it is called in this document (https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf) and if you scroll down to the section entitled "Scoring Data the Old-Fashioned Way", you will find code to do this.
Since @Rick_SAS has written blog posts on everything you might ever want to do in SAS, here's his blog post on the subject.
My approach would be to add the additional values into the base data for the independent variable(s), x axis,and missing values for the dependent variable(s), y-axis, and use an appropriate regression procedure to create predicted values and use the resulting data set to plot such extrapolated values. Recommend including the estimated confidence limits as well.
What @ballardw is referring to (I think) is the "Missing Response Trick", at least that's what it is called in this document (https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf) and if you scroll down to the section entitled "Scoring Data the Old-Fashioned Way", you will find code to do this.
Since @Rick_SAS has written blog posts on everything you might ever want to do in SAS, here's his blog post on the subject.
@PaigeMiller wrote:
What @ballardw is referring to (I think) is the "Missing Response Trick", at least that's what it is called in this document (https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf) and if you scroll down to the section entitled "Scoring Data the Old-Fashioned Way", you will find code to do this.
Since @Rick_SAS has written blog posts on everything you might ever want to do in SAS, here's his blog post on the subject.
Learned that back about 1986, so I guess it qualifies as "old fashioned". At least we don't really have to use Proc Plot to show results... (Really, not GPlot, not Sgplot but line-printer text based Proc Plot).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.