BookmarkSubscribeRSS Feed
eap
Obsidian | Level 7 eap
Obsidian | Level 7

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:

  1. I need the variance/covariance matrix. Is this identical to the Covariance Matrix for Fixed Effects table?
  2. Can I get the individual treatment effects for each of the 3 treatments too?
  3. Or use info from the variance/covariance matrix to create them?
  4. Or is there a multi-step process that uses Proc Glimmix and something else?

 

I appreciate any guidance.

Thanks in advance!

10 REPLIES 10
PaigeMiller
Diamond | Level 26

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

--
Paige Miller
eap
Obsidian | Level 7 eap
Obsidian | Level 7

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,

  1. Does it matter that the variance/covariance and lsmeans results will incorporate random effects and that ATEs won’t? Or is this to be expected?
  2. Do I need to use 3 separate treatment variables in Proc Glimmix to match the Proc Causaltrt? It runs fine either way but I was wondering about comparing apples to apples.

 

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!

PaigeMiller
Diamond | Level 26

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:

@SteveDenham 

@Rick_SAS 

@StatDave 

@jiltao 

--
Paige Miller
eap
Obsidian | Level 7 eap
Obsidian | Level 7

I appreciate your helpfulness just the same and thanks for names of potential experts in this matter!

ballardw
Super User

@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.

eap
Obsidian | Level 7 eap
Obsidian | Level 7

Thanks again @PaigeMiller for a list of people with potential insight:

@SteveDenham 

@Rick_SAS 

@StatDave 

@jiltao 

 

I'll check regularly to see if anyone answers.

sbxkoenk
SAS Super FREQ

@eap wrote:

Other Questions:

  1. I need the variance/covariance matrix. Is this identical to the Covariance Matrix for Fixed Effects table?

Which variance-covariance matrix do you need?

  • There's the G-matrix which is the variance-covariance matrix of the the random effect vector g.
  • There's the R-matrix which is the variance-covariance matrix of the random error vector e.
  • There's the V-matrix which is the variance-covariance matrix for an observation (i.e. of y -- the outcome).
  • And there is indeed the variance-covariance matrix of the GLS fixed effect estimates.

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

eap
Obsidian | Level 7 eap
Obsidian | Level 7

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?

eap
Obsidian | Level 7 eap
Obsidian | Level 7

Thank you @Ksharp  this is very helpful!

SAS Innovate 2025: Register Now

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!

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
  • 10 replies
  • 1798 views
  • 0 likes
  • 5 in conversation