Does anyone know how to modify/edit the variables appearing in the fit plots' summary box (in the output)? I want to include the p-value and standard error.
I am using:
PROC REG DATA=Test1 CORR;
MODEL Y=X / CLB P CLM;
RUN;
Thanks!
Save these statistics and Plot it by PROC SGPLOT.
ods output ParameterEstimates=x;
PROC REG DATA=sashelp.class CORR ;
MODEL height=weight / CLB P CLM;
quit;
proc sql ;
select catx(' ',Variable,'StdErr:',put(StdErr,8.2)) into : StdErr from x
where Variable='Weight'
;
select catx(' ',Variable,'PValue:',put(Probt,pvalue8.2)) into : Probt from x
where Variable='Weight'
;
quit;
proc sgplot data=sashelp.class;
reg y=height x=weight/clm;
inset "&StdErr." "&Probt.";
run;
Save these statistics and Plot it by PROC SGPLOT.
ods output ParameterEstimates=x;
PROC REG DATA=sashelp.class CORR ;
MODEL height=weight / CLB P CLM;
quit;
proc sql ;
select catx(' ',Variable,'StdErr:',put(StdErr,8.2)) into : StdErr from x
where Variable='Weight'
;
select catx(' ',Variable,'PValue:',put(Probt,pvalue8.2)) into : Probt from x
where Variable='Weight'
;
quit;
proc sgplot data=sashelp.class;
reg y=height x=weight/clm;
inset "&StdErr." "&Probt.";
run;
Thank you so much, Ksharp.
I did try your code but it did not generate what I wanted. I found another one in this link https://support.sas.com/kb/65/202.html but the box with the summary is not shown correctly (as shown in the image). Any suggestions?
Thank you so much, Ksharp.
I stopped using the software for several hours, and then when I tried again, it worked without putting your suggestion. However, now I get a warning that does not allow p-value and St Err to show in the summary box. As you can see in my previous graph, it worked (at least I could see the values), but now it does not. I wonder if it is a software issue. See the warning below. Any suggestion would be appreciated.
You might want want to do a "proc print data=x; run;" to make sure those parameters are in your data set.
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.