Steve, This is a (rather delayed) followup to a question that Steve Denham answered in September 2011. Please check my question "How to make LSM differences more useful in PROC GENMOD?" My problem at that time was to figure out how to create a Least Squares Means Difference result from procedures when the link was not linear; in those cases (for example in PROC GLIMMIX, GENMOD, etc.) the ilink option result for the LS means is correct, but the LS means differences are wrong (ilink does not know that you cannot subtract 2 log quantites--the programming deficiency needs to be upgraded). Your answer was quite clever (as usual, Steve!) but I have found that the std. error and confidence intervals produced by this method are much too large. To diagnose the problem, I ran a link=id model instead of a link=log model (in this case, the ilink gives the right LSM difference result,) so we can use that example to see where the problem lies. As you can see in the upper table, your method to calculate the Std. Error of the individual LSM estimates is exactly the same as the SAS output, but the pooled Std Err estimates are much higher (middle table), so the resulting confidence intervals are much wider than what SAS computes (lower table). The problem seems to be how to calculate the std err for the LSM difference--the pooled method adds the errors, but apparently we need some other method. Do you have any ideas? Ron Levine Least Squares Means (Output from model and Steve's Std Err calculation) cohort CombinedCompl Estimate StdErr (SAS) StdErr (Steve) DF tValue Probt a_COMBO 0 12.7795 0.7772 0.77722 153769 16.44 <.0001 a_COMBO 1 19.5782 0.7786 0.77862 153769 25.14 <.0001 b_VALVE 0 12.2007 0.7746 0.77462 153769 15.75 <.0001 b_VALVE 1 18.375 0.7763 0.77634 153769 23.67 <.0001 c_CABG 0 10.3971 0.7719 0.77191 153769 13.47 <.0001 c_CABG 1 14.9921 0.7732 0.7732 153769 19.39 <.0001 Least Squares Means Differences (Steve method) Obs cohort CombinedCompl meandiff poolstderr DF _95pctLCL _95pctUCL Probt 1 a_COMBO 0 6.79872 1.10014 153769 4.64248 8.95496 <.0001 2 b_VALVE 0 6.17431 1.0967 153769 4.02481 8.32381 <.0001 3 c_CABG 0 4.59502 1.09256 153769 2.45363 6.73641 <.0001 Least Squares Means Differences (SAS method) Obs cohort CombinedCompl Estimate Standard Error DF _95pctLCL _95pctUCL Pr > |t| 1 a_COMBO 0 6.7987 0.1435 153769 6.5175 7.08 <.0001 2 b_VALVE 0 6.1743 0.1159 153769 5.9471 6.4016 <.0001 3 c_CABG 0 4.595 0.06972 153769 4.4584 4.7317 <.0001
... View more