Announcement

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

  • Standard error of ATE and POMean in teffects

    Hello,

    I am estimating the treatment effect using the teffects package. And as a part of my study, I have to manually replicate the results from teffects (RA, IPW, IPWRA) using OLS and WLS. The estimations of ATE came out fine, I got the similar results as those from teffects. But my problem is related to the standard errors of the potential outcome and ATE. I can't seem to redo this manually even after trying many formulas of SE that I found. I also tried to look for the original paper(s) related to the construction of teffects but I found none (very weird, I don't know why). So my question is how can I estimate the SEs that are similar to those from teffects, manually?

    Here is my code:
    Code:
    use https://www.stata-press.com/data/r17/cattaneo2.dta
    
    // Estimating simple ATE via teffects ra
    teffects ra (bweight mage) (mbsmoke)
    
    // Manually
    reg bweight mage if mbsmoke == 1
        predict bweight1
    
    reg bweight mage if mbsmoke == 0
        predict bweight0
    
    gen ATE = bweight1 - bweight0
        sum ATE
    My ATE variable has the same mean to the ATE estimated by the teffects ra but the SEs were not similar. Also, the bweight0 variable has the same mean as the POmean estimated from teffects; but their SEs are different. I think that this has something to do with the prediction SE from OLS, right? I also try to use the standard SE calculated from variance of bweight1 and bweight0 (as if this is from an RCT), but it doesn't work. And this applies to my IPW and IPWRA estimators as well because I don't know the correct formula for SEs of PO and ATE.

    Please help me with this. Thanks in advance!

  • #2
    Hi Chinh,

    Unfortunately I don't have a neat answer to your question, but I think it is related to the fact that there are multiple steps IPWRA and therefore it uses gmm to estimate the SEs

    See:
    HTML Code:
    https://blog.stata.com/2014/12/08/using-gmm-to-solve-two-step-estimation-problems/
    and #2 in this post:
    HTML Code:
    https://www.statalist.org/forums/forum/general-stata-discussion/general/1521926-what-does-teffects-ipwra-actually-do
    This second post was helpful in for my understanding of how IPWRA works, but I've failed to replicate even the ATE (let alone SEs) using my own data and I am not sure why..

    I've merged treatment sample survey data to nationally representative data (thus $treatment = source) and am looking at whether it increases the proportion of people who are no longer lonely (nllonely) (i.e. reduces loneliness);

    Code:
    ** trying to replicate ATE from standardised weighted below which is 7.67% p = 0.001
    teffects ipwra (nllonely $xlist, logit)           ///
                   ($treatment $xlist pnq3) [pw=ipw_weight], vce(robust)     
    
    ** OR replicated unstandardised weighted version ATE = 7.34% p = 0.001
    teffects ipwra (nllonely $xlist, logit)           ///
                   ($treatment $xlist pnq3), vce(robust)  
    
    * Following code from: https://www.statalist.org/forums/forum/
    *general-stata-discussion/general/1521926-what-does-teffects-ipwra-actually-do
    
    tempvar source0 p source1 ate 
    
    ** treatment model
    logit $treatment $xlist pnq3 
    predict `p' , pr // predict probability of treatment given characteristics
    
    // outcome
    regress nllonely $xlist [pw = 1/(1-`p')] if !source 
    predict `source0', xb // predict prop NLL for those who are unexp to treatment, std weighted by inverse of 1-PS
    regress nllonely $xlist [pw = 1/`p'] if source  
    predict `source1', xb // predict prop NLL for those exp to treatment, std weighted by inverse of PS
    
    // ATE
    generate `ate' = (`source1' - `source0') 
    summarize `ate' 
    ** for some reason ate is ~6% (0.0604) (s.d. of 0.3004)  
    ** same if using ipw_weight (standardised weights using population proportions in numerator) or unstandardised weights (1/1-p and 1/p)
    Will post in a separate thread, but if anyone can see my mistake please let me know!

    Kind regards,
    Hannah

    Comment


    • #3
      Take a look at here
      https://repec.sowi.unibe.ch/files/wp35/jann-2020-IF.pdf
      where Ben Jann tells you not only how the point estimates are derived but also how the standard errors can be estimated
      f

      Comment

      Working...
      X