@StatDave will probably have more to say on this, but here goes:
To get the chi-squared values for these comparisons on the original scale (rather than a ratio of the log odds that using the ilink option gives), you'll need the %NLmeans and %NLest macros. Be sure you are using the most recent versions of these.
Try the following code:
proc glimmix data=have;
class visit obesity group;
model obesity (event='1')=visit group visit*group/ dist=binary link=logit ddfm=bw solution;
random intercept / subject=id solution;
lsmeans visit|group;
store logitfit;
ods output coef=coeffs;
run;
proc plm restore=logitfit;
lsmeans visit group visit*group/e ilink diff=control;
slice visit*group/e sliceby=visit diff=control ilink;
slice visit*group/e sliceby=group diff=control ilink;
ods output coef=coeffs lsmeans=lsmeans;
run;
/* These addresses will have to be changed. There is a chance that you are working with a version of SAS that has these macros included, such that %include statements are not needed */
%include "B:\Steve\GLIMMIXforSAS\nlmeans.sas";
%include "B:\Steve\GLIMMIXforSAS\nlest.sas";
%nlmeans(version,instore=logitfit, coef=coeffs, link=logit, diff=1, null=0, title=Diff of Mean Proportions)
The log will have a bunch of WARNING statements about the final Hessian not being positive definite, but they can all be ignored. The pertinent output are:
GLIMMIX type3 tests and least squares means on both the logit scale and proportion scale
NLmeans output from the LSMEANS and SLICE statements with the estimated difference and standard error on the proportion scale, a Wald chi-square value and associated p value, and the bounds for a 95% confidence interval on the difference. Unfortunately, I have never been able to figure out how to change the label on the default printout, but in this case, you can get the associated effects by going in order through the lsmeans and slice statements.
1. labels are 1 -1 0 and 1 0 -1: Differences in marginal lsmeans for visits compared to baseline
2. label is 1 -1: Difference in marginal lsmeans for groups, comparing to group A
3. A table with five labels: Difference in lsmeans compared to baseline of group A
4. label is 1 -1: Difference in lsmeans for groups, at visit=0
5. label is 1 -1: Difference in lsmeans for groups, at visit=1
6. label is 1 -1: Difference in lsmeans for groups, at visit=2
7. labels are 1 -1 0 and 1 0 -1: Difference in lsmeans for visits 1 and 2 from baseline, for group A
8. labels are 1 -1 0 and 1 0 -1: Difference in lsmeans for visits 1 and 2 from baseline, for group B
Hope this helps.
(In my analysis, neither of the main effects nor the interaction are significant, so in my opinion, comparisons are probably something that are valid only if pre-specified.)
SteveDenham
... View more