- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 + plm
genmod (effectplot)
glimmix / 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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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