Thank you, this is perfect, I didn't know about the JOINT option. Just for any others looking at this post, here is the final code with I believe all the correct zeros and everything. ods output lsmeans=lsms lsmestimate=lsmests;
proc mixed data=eff_pop method = reml;
class subj trt visit agegroup hist;
model chg = trt visit agegroup trt*visit trt*agegroup
visit*agegroup trt*visit*agegroup base cont hist / ddfm=kr solution outp=predict;
repeated visit / type=un subject=subj;
lsmeans trt*visit*agegroup;
lsmestimate trt*visit*agegroup
'Difference within age group 1 at visit 4, trt 1 vs. 2' 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
'Difference within age group 2 at visit 4, trt 1 vs. 2' 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
'Difference within age group 3 at visit 4, trt 1 vs. 2' 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0/ joint;
run;
ods rtf close;
... View more