BookmarkSubscribeRSS Feed
Ameurgen
Obsidian | Level 7

Hi  Sas community;

I need help to plot my output LSMEANS form proc hpmixed , your can comment the code below , for the first plot estimate vs DAMDIM (Axe1) and Mean for AXe2 its work using proc gplot , but when i used interaction BHB*DAMDIM, i cant figure out how the plot should be, alos, i am thing to plot them seperately but i don't now .

Thank you for your helping me

********************************************

without interaction 

**************************

/* Dam days in milk effect **/
data lsmns12;
set lsmns11;
IF (Effect eq 'Dam_DIM');
Dam_DIM = Dam_DIM ;
mean = Estimate;
output;
mean = Estimate - StdErr;
output;
mean = Estimate + StdErr;
output;
run;

/***/
axis1 order=(30 to 240 by 10);
axis2 label=(angle=90) order=(1.5 to 2.6 by 0.1);
symbol1 interpol=none color=blue value=dot line=2 ;
symbol2 interpol=hiloctj color=red line=1 height=1.5;

title 'daughter Total Services vs dam_days_in_milk at daughter conception, Parity 1';
proc gplot data=lsmns12;
plot Estimate *Dam_DIM/vaxis=axis2 haxis=axis1 ;
plot2 Mean*Dam_DIM/vaxis=axis2 ;
run;
quit;

*******************************

with interaction

************************

 

/* Dam days in milk and BHB level interaction effect **/
data lsmns11_INTR1;
set lsmns11_INTR;
IF (Effect eq 'DamDIM*BHB');
DAM_DIM_BHB_Intr = 'DamDIM*BHB' ;
mean = Estimate;
output;
mean = Estimate - StdErr;
output;
mean = Estimate + StdErr;
output;
run;

/***/
axis1 order=(30 to 250 by 10);
axis2 order=(0 to 4 by 1);
axis3 label=(angle=90) order=(-2 to 8 by 1 );
symbol1 interpol=none color=blue value=dot line=2 ;
symbol2 interpol=hiloctj color=red line=1 height=1.5;
symbol3 interpol=hiloctj color=red line=1 height=1.5;

title 'daughter Total Services vs dam_DIM and BHB level interaction, Parity 1';
proc gplot data=lsmns11_INTR1;
plot Estimate * Dam_Days_in_MILK /vaxis=axis2 haxis=axis1 ;
plot2 Mean*BHB_level/vaxis=axis3 haxis=axis1;
*plot2 Mean*Dam_Days_in_MILK/vaxis=axis2 ;
run;

 

Thank you 

cheers

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

You don't really say what PROC you use to estimate the interactions, and obtain error estimates from — which are needed to get confidence interval "error bars". That information would be very helpful. Nevertheless, the EFFECTPLOT statement in many PROCs can do this (example).

--
Paige Miller
Ameurgen
Obsidian | Level 7

Hi sir,

Its mentionned i used proc hpmixed fro my muxed model analysis, the interaction is estimate by  lsmeans function, i create the mean +/- estimate to output my lower and upper limit. all detail are in the shared code. but i will look at your propositon effectplot , which i thing good alternative 

Thank you sir for youyr help

 

AMEUR

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 455 views
  • 0 likes
  • 2 in conversation