Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Estimating effect heterogeneity after -teffects ipwra-

    Good afternoon,

    I am hoping to receive some clarity on evaluating effect heterogeneity after estimating treatment effects on the treated using the -teffects ipwra- command. Please see the end of the post for our current code with -teffects ipwra- and a potential approach using -etregress-.

    The aim of this project is to understand if the effect of the exposure (A=0,1) on the outcome (Y, continuous) amongst those who were treated (ATET) differs between two subgroups (S=0,1). Given that the -margins- command is not acceptable after the use of a -teffects ipwra- command, we are attempting to estimate effect heterogeneity by calculating the conditional means for each subset population. If -margins- were acceptable, we would do this by estimating the marginal effects at each level of S:

    Code:
    margins, at(S=(0 1))
    In notation, we hope to estimate the following: [E(Y(1) | S=1,A=1) - E(Y(0) | S=1,A=1)] - [E(Y(1) | S=0,A=1) - E(Y(0) | S=0,A=1]

    Where:
    1. E(Y(1) | S=1,A=1) is the mean of Y if everyone in group S=1 of the treated population (A=1) received treatment
    2. E(Y(0) | S=1,A=1) is the mean of Y if everyone in group S=1 of the treated population (A=1) did not receive treatment (counterfactual)
    3. E(Y(1) | S=0,A=1) is the mean of Y if everyone in group S=0 of the treated population (A=1) received treatment
    4. E(Y(0) | S=0,A=1) is the mean of Y if everyone in group S=0 of the treated population (A=1) did not receive treatment (counterfactual)
    where Y is the outcome, S is the modifier, and A is the treatment.

    There are three questions that we have at this point:
    1. Can we assume that E(Y(0) | S=1,A=1) is the potential-outcome mean presented in the outcome of the -teffects- command below?
    2. Would a valid alternative to using -teffects ipwra- be to use the -etregress- command after manually calculating inverse probability of treatment weights and including them in the -etreg- command, thereafter estimating the ATET by levels of the modifier variable?
    3. Is there another way in Stata that we should consider approaching this research question? We seek to estimate the ATET and then effect heterogeneity after.
    Approach #1 using -teffects ipwra-
    Code:
     teffects ipwra (Y S AS X1 X2 X3) (A X1 X2 X3 S S#X1 S#X2 S#X3), atet
     Estimator: IPW regression adjustment
    Outcome model  : linear
    Treatment model: logit
    
    --------------------------------------------------------------------------------------------------------------
                                                 |               Robust
                                               Y | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    ---------------------------------------------+----------------------------------------------------------------
    ATET                                         |
                                               A |
                                   (A=1 vs A=0)  |   2.146543   .6613462     3.25   0.001     .8503278    3.442757
    ---------------------------------------------+----------------------------------------------------------------
    POmean                                       |
                                               A |
                                            A=0  |   5.669784   .3071079    18.46   0.000     5.067864    6.271704
    --------------------------------------------------------------------------------------------------------------
    Approach #2 using -etregress-
    Code:
    etreg Y S A#S X1 X2 X3 [w=atet_wt], treat(A = S X1 X2 X3 S#X1 S#X2 S#X3) vce(robust)
    [output omitted]
    
    . margins r.S, vce(unconditional) predict(cte) subpop(if A==1)
    
    Contrasts of predictive margins                        Number of obs   = 1,099
                                                           Subpop. no. obs =    98
    
    Expression: Conditional treatment effect, predict(cte)
    
    ------------------------------------------------
                 |         df        chi2     P>chi2
    -------------+----------------------------------
               S |          1        6.67     0.0098
    ------------------------------------------------
    
    ------------------------------------------------------------------------------------------------------
                                                         |            Unconditional
                                                         |   Contrast   std. err.     [95% conf. interval]
    -----------------------------------------------------+------------------------------------------------
                                                       S |  |   -4.07673   1.578554      -7.17064   -.9828211
    ------------------------------------------------------------------------------------------------------
    Thank you so much for your help! We are so grateful for any tips or pointers on this topic.
    Last edited by Rajesh Satpathy-Horton; 03 Apr 2025, 13:15. Reason: Typos
Working...
X