Announcement

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

  • Postestimation saving results for ps matching

    Hello, for teffects psmatch (or psmatch2, if easier), is it possible to use have Stata save the main coefficients and p-values so that I can use regsave? I tried post: with no success.
    Would be something like:
    Code:
    teffects psmatch, post: (y) (x1 x2)
    regsave using 'example', pval detail(all)
    Edit: I see in the teffects psmatch helpfile that r(table) is saved as a matrix containing coefficients and p-values, perhaps easiest to call that? Not sure how to in regsave, though, as I think regsave may only be able to collect e().
    Last edited by Taylor Walter; 27 Aug 2022, 14:38.

  • #2
    teffects psmatch stores the coefficient vector from the propensity score model in e(bps). the option coefmat(matname) instructs regsave (SSC) to retrieve coefficient estimates from matname instead of e(b).
    Code:
    . webuse cattaneo2, clear
    (Excerpt from Cattaneo (2010) Journal of Econometrics 155: 138–154)
    
    . teffects psmatch (bweight) (mbsmoke mmarried c.mage##c.mage fbaby medu)
    
    Treatment-effects estimation                   Number of obs      =      4,642
    Estimator      : propensity-score matching     Matches: requested =          1
    Outcome model  : matching                                     min =          1
    Treatment model: logit                                        max =         74
    ----------------------------------------------------------------------------------------
                           |              AI robust
                   bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -----------------------+----------------------------------------------------------------
    ATE                    |
                   mbsmoke |
    (Smoker vs Nonsmoker)  |  -210.9683     32.021    -6.59   0.000    -273.7284   -148.2083
    ----------------------------------------------------------------------------------------
    
    . regsave using results, coefmat(e(bps)) replace
    file results.dta saved
    
    . use results, clear
    
    . list, clean
    
                             var        coef   stderr      N  
      1.        mbsmoke:mmarried   -1.145706   32.021   4642  
      2.            mbsmoke:mage     .321518        .   4642  
      3.   mbsmoke:c.mage#c.mage   -.0060368        .   4642  
      4.           mbsmoke:fbaby   -.3864258        .   4642  
      5.            mbsmoke:medu   -.1420833        .   4642  
      6.           mbsmoke:_cons   -2.950915        .   4642

    Comment


    • #3
      Thanks Oyvind Snilsberg. Two quick questions:

      First, how can I save the average treatment effect (so in your example, -210.9683)? That is the value that I am hoping to save with regsave.
      Second, how does it store the pvalues? Am I able to get those for the average treatment effect as well?
      Last edited by Taylor Walter; 27 Aug 2022, 15:22.

      Comment


      • #4
        oh, I see. just run regsave without coefmat option. add pval option to get p-values.
        Code:
        . webuse cattaneo2, clear
        (Excerpt from Cattaneo (2010) Journal of Econometrics 155: 138–154)
        
        . teffects psmatch (bweight) (mbsmoke mmarried c.mage##c.mage fbaby medu)
        
        Treatment-effects estimation                   Number of obs      =      4,642
        Estimator      : propensity-score matching     Matches: requested =          1
        Outcome model  : matching                                     min =          1
        Treatment model: logit                                        max =         74
        ----------------------------------------------------------------------------------------
                               |              AI robust
                       bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        -----------------------+----------------------------------------------------------------
        ATE                    |
                       mbsmoke |
        (Smoker vs Nonsmoker)  |  -210.9683     32.021    -6.59   0.000    -273.7284   -148.2083
        ----------------------------------------------------------------------------------------
        
        . regsave using results, pval replace
        file results.dta saved
        
        . use results, clear
        
        . list, clean
        
                             var        coef   stderr       pval      N  
          1.   ATE:r1vs0.mbsmoke   -210.9683   32.021   4.44e-11   4642
        Code:
        help regsave
        Last edited by Øyvind Snilsberg; 28 Aug 2022, 00:43.

        Comment


        • #5
          Thank you very much!

          Comment

          Working...
          X