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

Hello all,

 

I am comparing plots produced by PROC MIXED (+ PROC PLM), GENMOD (using the EFFECTPLOT) and GLIMMIX with spline (+  PROC PLM).  The  first two (MIXED and GENMOD) give identical results while GLIMMIX with spline gives me a different result. This clearly depends on the spline option. As can be seen in the syntax that I include, the plot for GLIMMIX  is with effect spl=spline(segment);  I tried effect spl=spline(segment/naturalcubic);

Of course the plot changes, but is still very different than what I obtain with MIXED or GENMOD. 

 

The variable segment is standardized, and it has 10 levels (-1.57    -1.22    -0.87    -0.52    -0.17    0.17     0.52     0.87     1.22     1.57) -- I treat it as a continuous variable, of course.

 

Any suggestion on how to define the spline, to get the same plots as MIXED and GENMOD?

 

mixed + plmmixed + plmgenmod (effectplot)genmod (effectplot)glimmix / spline + plmglimmix / spline + plm

 

 

proc mixed data=e ;
class id iv;
model posemo= iv|segment|segment|segment;
random id;
store mod;
run;

proc plm source=mod;
effectplot slicefit(x=segment sliceby=iv);
run;

proc genmod data=e ;
class id iv;
model posemo= iv|segment|segment|segment;
repeated subject=id;
effectplot slicefit(x=segment sliceby=iv);
run;

proc glimmix data=e;
class id iv;
effect spl=spline(segment);
model posemo = iv*spl / noint s;
random int / subject=id;
store mod3;
output out=gmxout pred=p;
run;

proc plm source=mod3;
effectplot slicefit(x=segment sliceby=iv);
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
emaneman
Pyrite | Level 9

Thank you Dave, 

I played around with the estimate & polynomial, and that works. The spline remains, as you suggested in my previous post, an excellent solution. 

Eman

View solution in original post

2 REPLIES 2
StatDave
SAS Super FREQ

If you use a spline, it won't be the same. A spline is much more flexible than the polynomial you used in GENMOD and MIXED. Polynomials are more restricted in how they appear as you can see in the plot. See another example of this in this note.  If you want the plot from GLIMMIX to be the same, then use the same cubic polynomial that you used in GENMOD and MIXED, either like you did in the MODEL statement or using POLYNOMIAL in the EFFECT statement instead of SPLINE.

emaneman
Pyrite | Level 9

Thank you Dave, 

I played around with the estimate & polynomial, and that works. The spline remains, as you suggested in my previous post, an excellent solution. 

Eman

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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