Thank you! This is exactly what I needed. After your initial post, I was able to save the predicted values using ods output. Then, I created a new "group" variable using the "_plotby" and "_group" variables and modified the sgplot code you provided here by adding "/group=z" after the series. Now I just need to learn how to tweak the colors! Here is the full code in case anyone else ever has this question:
ods graphics on ; ods trace on; proc genmod data=tempd plots=(resraw resdev); model prjdlqad = female age16p famsplit famstep famoth finsesza acachfs impulsza allblfza morctxza impulsza*allblfza impulsza*morctxza allblfza*morctxza / dist=nb link=log; store nbmodel1; run; ods listing style=statistical; title "Impulsivity & Projected Delinquency, by Moral Beliefs & Context"; proc plm source=nbmodel1; effectplot slicefit(x=impulsza sliceby=allblfza= -8.12 8.12 plotby=morctxza= -4.42 4.42) / CLM at(female=0 age16p=0 famsplit=0 famstep=0 famoth=0) ; ods output SliceFitPanel = mygraph; run;
data mygraph2; set mygraph; if _plotby = "morctxza=-4.42" & _group = -8.12 then morfiltr = 1; if _plotby = "morctxza=-4.42" & _group = 8.12 then morfiltr = 2; if _plotby = "morctxza=4.42" & _group = -8.12 then morfiltr = 3; if _plotby = "morctxza=4.42" & _group = 8.12 then morfiltr = 4; run;
proc sgplot data=mygraph2; title "Impulsivity & Projected Delinquency, by Moral Beliefs & Context"; band x=_xcont1 lower=_lclm upper=_uclm / group=morfiltr; series x=_xcont1 y=_predicted/group=morfiltr lineattrs=(color=red); run;
Thanks again. I really appreciate the help!
Jon
... View more