I’m conducting a mixed effects logistic regression analysis for a client to assess outcome associated with different types of treatment. I’ve attached a mock SAS dataset of ~175. The actual dataset is 10K+.
Per project instructions, I need to estimate the average treatment effects (ATEs) by averaging the predicted probability of the outcome across the sample if each variable separately is coded as a 1 vs a 0. All other variable values will remain constant.
I attempted to address this by using the code below but it doesn’t seem right:
proc glimmix data=test175;
class hlthcenter doctor_id treatment sex typvisit;
model outcome (event = '1')= treatment age sex typvisit/ dist=binary link=logit oddsratio solution ddfm=bw covb;
random intercept / subject= hlthcenter;
random intercept / subject= doctor_id(hlthcenter);
lsmeans treatment/ oddsratio ilink diff=all cl adjust=bon;
output out=glimxout predicted(blup ilink)=pp ucl=higher lcl=lower;
id patient_id;
run;
I get individual predicted probabilities per patient but don’t know how to get per individual treatment or the average treatment.
Am I completely off the mark?
Other Questions:
I appreciate any guidance.
Thanks in advance!
See here: https://support.sas.com/kb/30/333.html
Use your web browser's text search feature to search in this web page for Average Treatment Effect
Thank you, @PaigeMiller, for directing me to the Proc Causaltrt procedure! It seems the procedure does not support treatment variables with >2 levels so I modified my SAS dataset to create 3 separate treatment variables with (yes/no) instead of a single variable with 3 levels. It worked!
Questions:
However,
proc glimmix data=test175;
class hlthcenter doctor_id treatment sex typvisit;
model outcome (event = '1') = treatment age sex typvisit/ dist=binary link=logit oddsratio solution covb;
random intercept / subject= hlthcenter;
random intercept / subject= doctor_id(hlthcenter);
lsmeans treatment/ oddsratio ilink diff=all cl adjust=bon;
id patient_id;
run;
*ATEs for Treatment1 – repeat by updating psmodel for treatment2 and treatment3;
proc causaltrt data=test175 method=regadj poutcomemod;
class sex typvisit;
psmodel treatment1(ref='0');
model outcome (event='1')= age sex typvisit/ dist=binary link=logit;
run;
Thanks!
So my particular skill in this area is that I know about that link, where many different statistical techniques are referenced and you can find SAS code to perform those statistical techniques.
My ability to advise on PROC CASUALTRT is zero. I think perhaps some of these people may be able to offer actual advice:
I appreciate your helpfulness just the same and thanks for names of potential experts in this matter!
@eap wrote:
I appreciate your helpfulness just the same and thanks for names of potential experts in this matter!
@PaigeMiller's post with the names notifies those individual about this thread that they have been mentioned. That may bring them into the discussion.
Thanks again @PaigeMiller for a list of people with potential insight:
I'll check regularly to see if anyone answers.
@eap wrote:
Other Questions:
- I need the variance/covariance matrix. Is this identical to the Covariance Matrix for Fixed Effects table?
Which variance-covariance matrix do you need?
See here for some explanation:
INTRODUCTION TO GENERALIZED LINEAR MIXED MODELS
https://stats.oarc.ucla.edu/other/mult-pkg/introduction-to-generalized-linear-mixed-models/
Koen
Thanks for the article however it didn't shed much light for me. I think I'm interested in variance-covariance matrix of the GLS fixed effect estimates but not isre.
For example,
Do the odds of having Tx1 differ for Tx2 vs Tx3 more than they differ for not having Tx1?
Thank you @Ksharp this is very helpful!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.