Announcement

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

  • predicted probability after teffects ipwra

    Hi Statalisters,

    I'm using the teffects ipwra command for a research project and I have a question. Since I'm new to this estimation strategy, my question might seem basic.

    In a logit analysis, we can easily find the predicted probabilities of covariates using the margins command after running the logit model. I'm wondering how to do this after running a teffects model. Specifically, I'm interested in finding the margins for gender (male and female).

    Is my question valid one?

    Any guidance would be greatly appreciated.





    Click image for larger version

Name:	Screenshot 2024-05-19 132501.png
Views:	1
Size:	138.9 KB
ID:	1753799



    Warm regards,
    ​​​​​​​Ajay

    Last edited by ajay pasi; 19 May 2024, 02:11.

  • #2
    I don't know if there's a way to do that using teffects ipw (as you did above) or teffects ipwra. But you can always get this by just estimating the propensity score model by logit and use the margins command -- just as you describe. Both IPW and IPWRA, as defaults, use standard logit models for the PS.

    Comment


    • #3
      the covariates are not in the final equation.

      Code:
      use https://www.stata-press.com/data/r18/cattaneo2 , clear
      
      teffects ipw (bweight) (mbsmoke foreign alcohol mage medu fage fedu , logit)
      
      qui logit mbsmoke foreign alcohol mage medu fage fedu
      qui predict double ps if e(sample)
      qui gen double ipw = 1.mbsmoke/ps + 0.mbsmoke/(1-ps)
      reg bweight i.mbsmoke [pw=ipw]
      I'm interested in how Jeff proposes to get the effect of female. Easy enough to get the margins on mbsmoke, but not sure where to go from there.

      Comment


      • #4
        This?

        Code:
        use https://www.stata-press.com/data/r18/cattaneo2 , clear
        
        teffects ipw (bweight) (mbsmoke foreign alcohol mage medu fage fedu , logit)
        
        logit mbsmoke foreign alcohol mage medu fage fedu
        qui predict double ps if e(sample)
        qui gen double ipw = 1.mbsmoke/ps + 0.mbsmoke/(1-ps)
        margins, over(foreign) post
        local f0 = e(b)[1,1]
        local f1 = e(b)[1,2]
        reg bweight mbsmoke [iw=ipw]
        margins, at(mbsmoke = (`f0' `f1'))

        Comment


        • #5
          Thank you Jeff Wooldridge and George Ford

          Comment

          Working...
          X