BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tka726
Obsidian | Level 7

I am using GLIMMIX to estimate predicted probabilities of a binary outcome in 2 groups. I can get the predicted probabilities for each group (and subtract them to get the difference) but how do I compute the 95% CI for the difference of the predicted probabilities. I know that I can not use the Difference of LSMEANS as the inverse link is not linear.

 

PROC GLIMMIX DATA=multicenter ;
CLASS center group pt;
MODEL SideEffect/n = group / solution;
RANDOM center / solution;
LSMEANS group/ cl diff ilink;
run;

 

Predicted Probability for Group A is 0.2147

Predicted Probability for Group B is 0.3085.

Difference would be 0.0938, but how to get the CI of the difference?

tka726_0-1738695436800.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

If you really want to stick with a model-based approach, you can use the NLMeans macro as discussed and illustrated in this note. But since your data can be summarized simply as a 2x2 table, you could take a non-modeling approach and simply use the RISKDIFF option in the TABLES statement of PROC FREQ after setting it up to show the 2x2 table.  

View solution in original post

3 REPLIES 3
StatDave
SAS Super FREQ

If you really want to stick with a model-based approach, you can use the NLMeans macro as discussed and illustrated in this note. But since your data can be summarized simply as a 2x2 table, you could take a non-modeling approach and simply use the RISKDIFF option in the TABLES statement of PROC FREQ after setting it up to show the 2x2 table.  

tka726
Obsidian | Level 7

Thanks so much! The NLMeans macro provides exactly what I need.

 

proc glimmix data=multicenter ;
class center group ;
model SideEffect/n = group / solution; 
random center / solution; 
lsmeans group/ e cl diff ilink;
store out=proportions;
run;
 
proc plm restore=proportions;
lsmeans group/e ilink diff;
ods output coef=coeffs;
run;
 
 %NLMeans(instore=proportions, coef=Coeffs, link=logit, title=Differences of Predicted Probabilities)

 

StatDave
SAS Super FREQ
I just noticed that you have a random effect in the model. You could still use the NLMeans macro in the same basic way as shown in the note. But for a non-modeling approach, your data would be arranged as a stratified 2x2 table, with one stratum for each center. So, the PROC FREQ alternative would define the stratified table and then use the COMMONRISKDIFF option. For example:

proc freq; tables center*group*sideeff / commonriskdiff; run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 854 views
  • 4 likes
  • 2 in conversation