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

Hi SAS Community,

 

I am attempting to graph the LS Means from my mixed model in SAS 9.4. But for some reason the line doubles over back to the middle of the graph and I can't figure out why. I have attached my code for the model and graph as well as the means data that is being graphed and a photo of the problem graph. Thanks in advance for your advice!

 

Cara

 

SAS Output

 

 Effect           txgroup   visit      Estimate   StdErr    DF         tValue     Probt    Alpha     Lower     Upper 
txgroupHIV+_76.12600.7518399101.25<.00010.0574.648077.6041
txgroupHIV-_83.48530.7648399109.16<.00010.0581.981884.9887
visit_B1280.23430.7199354111.45<.00010.0578.818581.6502
visit_B2483.88520.7280354115.22<.00010.0582.453485.3169
visit_B075.29740.6983354107.82<.00010.0573.924076.6709
txgroup*visitHIV+B1276.13351.022635474.45<.00010.0574.122478.1447
txgroup*visitHIV+B2480.01971.032735477.49<.00010.0577.988682.0507
txgroup*visitHIV+B072.22491.032935469.92<.00010.0570.193474.2564
txgroup*visitHIV-B1284.33521.013635483.20<.00010.0582.341786.3287
txgroup*visitHIV-B2487.75071.026435485.49<.00010.0585.732089.7693
txgroup*visitHIV-B078.37000.940135483.37<.00010.0576.521280.2188

 

gplot6.png

 

 

ods output lsmeans=means1;
proc mixed data=ultrasound3 method=ml;
   class studyid;
   class txgroup (ref="HIV-");
   class visit (ref="B0");
   model insightstiff = txgroup visit visit*txgroup / s;
   repeated / type=cs subject=studyid group=txgroup;
   lsmeans txgroup visit visit*txgroup / cl adjust=tukey;
   format txgroup txgroupf. visit visitf.;
run;

proc print data=means1; run;

goptions reset=all;
symbol1 c=blue v=star h=.8 i=j;
symbol2 c=red v=dot h=.8 i=j;
symbol3 c=green v=square h=.8 i=j;
axis1 order=(60 to 100 by 5) label=(a=90 'Means');
Title1 'Achilles Insight SI';
Title2 'LS Means by HIV Status Across Study Period';
proc gplot data=means1;
  format estimate 8. visit visitf. txgroup txgroupf.;
  plot estimate*visit=txgroup / vaxis=axis1;
run; 
quit;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You should use SGPLOT, not GPLOT.

 

It's much better quality graphics and easier to use.

 

It's graphing the data in the order it appears - try re-ordering your data or see the ORDER options on SGPLOT.

View solution in original post

1 REPLY 1
Reeza
Super User

You should use SGPLOT, not GPLOT.

 

It's much better quality graphics and easier to use.

 

It's graphing the data in the order it appears - try re-ordering your data or see the ORDER options on SGPLOT.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2997 views
  • 0 likes
  • 2 in conversation