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

Innovate_SAS_Blue.png

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. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2823 views
  • 0 likes
  • 2 in conversation