BookmarkSubscribeRSS Feed
monona
Obsidian | Level 7
proc glm data=work.data_1;
	class z;
	model y=w z;
run;

Capture.PNGCapture.PNG

 

Appreciate if anyone could let me know how to add to the plot horizontal lines correspondent means for y in each group z.

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

I don't think such a facility is available in GLM. I think you have to pre calculate the mean values for each group and use the REFLINE Statement in PROC SGPLOT.

Ksharp
Super User

Save it as a dataset by :

ods output ANCOVAPlot=want;
proc glm data=sashelp.class;
class sex;
model weight =sex height;
quit;

 

 

and plot refline via PROC SGPLOT .

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 628 views
  • 0 likes
  • 3 in conversation