BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tebert
Obsidian | Level 7

I use proc glm, and glimmix mostly.

I like seeing the residual plots that I get from "plots=" statements in the procedure call.

With ods graphics on I get the residuals plots and I get a bar plot of differences from the multiple comparison procedure (MCP)

With ods graphics off I do not get the residuals plots but I get the results from the MCP as a compact letter display format.

 

Must I run the analysis twice to get the residuals plots and the MCP as a compact letter display?

I tried "ods graphics on" right before the "proc glm" statement and an "ods graphics off" right afterwards and that did not work.

 

Tim

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

PROC GLM is an interactive procedure, which means that you can use one PROC/RUN block to set up the model and analyze the data, and additional RUN blocks for further analysis. So you can turm ODS graphics ON and create the lines plot, then turn it OFF and get the table that contains the letters:

 

data wloss;
do diet = 'A','B','C','D','E';
   do i = 1 to 10;  input WeightLoss @@;  output;  end;
end;
datalines;
12.4 10.7 11.9 11.0 12.4 12.3 13.0 12.5 11.2 13.1
 9.1 11.5 11.3  9.7 13.2 10.7 10.6 11.3 11.1 11.7
 8.5 11.6 10.2 10.9  9.0  9.6  9.9 11.3 10.5 11.2
 8.7  9.3  8.2  8.3  9.0  9.4  9.2 12.2  8.5  9.9
12.7 13.2 11.8 11.9 12.2 11.2 13.7 11.8 11.5 11.7
;

ods graphics on;
proc glm data=wloss;
   class diet;
   model WeightLoss = diet;
   lsmeans diet / pdiff=all adjust=tukey LINES;   /* get Lines Plot */
run;
   ods graphics off;
   lsmeans diet / pdiff=all adjust=tukey LINES;  /* get table display */
run;
quit;

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

PROC GLM is an interactive procedure, which means that you can use one PROC/RUN block to set up the model and analyze the data, and additional RUN blocks for further analysis. So you can turm ODS graphics ON and create the lines plot, then turn it OFF and get the table that contains the letters:

 

data wloss;
do diet = 'A','B','C','D','E';
   do i = 1 to 10;  input WeightLoss @@;  output;  end;
end;
datalines;
12.4 10.7 11.9 11.0 12.4 12.3 13.0 12.5 11.2 13.1
 9.1 11.5 11.3  9.7 13.2 10.7 10.6 11.3 11.1 11.7
 8.5 11.6 10.2 10.9  9.0  9.6  9.9 11.3 10.5 11.2
 8.7  9.3  8.2  8.3  9.0  9.4  9.2 12.2  8.5  9.9
12.7 13.2 11.8 11.9 12.2 11.2 13.7 11.8 11.5 11.7
;

ods graphics on;
proc glm data=wloss;
   class diet;
   model WeightLoss = diet;
   lsmeans diet / pdiff=all adjust=tukey LINES;   /* get Lines Plot */
run;
   ods graphics off;
   lsmeans diet / pdiff=all adjust=tukey LINES;  /* get table display */
run;
quit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 874 views
  • 1 like
  • 2 in conversation