Here is the basic code:
proc sgplot data=df;
vline G / response=fits stat=mean;
I am doing the same thing for variables A-F. I want to panel them making a main effects mean plot for the response.
Can you help with the syntax? My problem with this is that the variables A-G are continuouos covariates and not levels of a factor.
I think it may be appropriate to use proc sgpanel. Right now I am doing these one at a time using sgplot code.
Formerly, proc gplot was used with proc greplay but I am assuming SAS has upgraded this approach. I am trying to keep this simple.
You likely want to add a variable to indicate which "panel" a specific graph belongs in. This might mean restructuring the data, possibly with Proc Transpose so that you have a variable indicating the original variable name. Then use Panelby statement with that new variable.
Likely there is more work involved in reshaping the data then the Sgpanel code.
Can you say more about what you are trying to accomplish?
In your program, you use PROC GENMOD to fit a regression surface that models the response Y as a linear function of the continuous covariates A, B, and C. Do you want to visualize slices through that surface as a function of each covariate while holding the other covariates fixed at their mean values? If so, use the EFFECTPLOT statement. One choice is as follows:
proc genmod data=so; model y = a b c / dist = normal link=identity lrci obstats; output out=sonorm pred=fits STDRESDEV=Z; effectplot fit (x=a); effectplot fit (x=b); effectplot fit (x=c); run; quit;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.