How can I combine the prediction plot of the three below models into one plot? If you can give me a sample code, I would really appreciate it. Thanks!
proc glm data = Test_data outstat = p_value plots=diagnostics;
model weight = bmi / CLPARM solution;
run;
proc glm data = plasma outstat = p_value plots=diagnostics;
model height = weight / CLPARM solution;
run;
proc glm data = plasma outstat = p_value plots=diagnostics;
model bmi = weight / CLPARM solution;
run;
Do you mean 3 plots side-by-side fitting on one page? Or 3 plots one above the other fitting on one page? Or some other arrangement fitting on one page?
Please explain.
Also, what is the purpose of modeling WEIGHT=BMI and then later BMI=WEIGHT?
Hi Paige,
Thank you for replying!
The order does not matter, and these are only template models, not the actual models. BMI and Weight could be replaced by any other variable. I just am looking for a sample code to combine different "glm" models' plots into one table/page of plots.
ODS EXCEL can put many plots onto a single tab, so you can just scroll down in Excel to see them all. Is that what you want?
ods excel file='myfile.xlsx' options(sheet_interval='NONE');
ods excel select diagnosticspanel(persist);
proc glm data = Test_data outstat = p_value plots=diagnostics;
model weight = bmi / CLPARM solution;
run; quit;
proc glm data = plasma outstat = p_value plots=diagnostics;
model height = weight / CLPARM solution;
run; quit;
proc glm data = plasma outstat = p_value plots=diagnostics;
model bmi = weight / CLPARM solution;
run; quit;
ods excel close;
It sounds like you want to use the ODS LAYOUT GRIDDED statement. See
https://blogs.sas.com/content/sasdummy/2015/11/23/ods-statement-options-to-change/
AND
https://blogs.sas.com/content/graphicallyspeaking/2017/08/14/advanced-ods-controlling-precisely-outp...
Here's how it would look for some sample data:
ods layout gridded columns=2 advance=table;
ods noproctitle;
ods graphics / width=400px height=300px;
ods select FitPlot(persist);
proc glm data = sashelp.heart outstat = p_value plots(MAXPOINTS=NONE)=diagnostics;
model weight = MRW / CLPARM solution;
run;
proc glm data = sashelp.heart outstat = p_value plots(MAXPOINTS=NONE)=diagnostics;
model height = weight / CLPARM solution;
run;
proc glm data = sashelp.heart outstat = p_value plots(MAXPOINTS=NONE)=diagnostics;
model MRW = weight / CLPARM solution;
run;
quit;
ods layout end;
Alternatively, you can write the data to a SAS data set and use PROC SGPANEL to create the graphs yourself.
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.