Announcement

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

  • using heteroskedasticity-based identification

    Hello,

    I am using Lewbel's (2012) approach with internal instruments. Can I use the ivreg2h command if my dependent variable is binary? If not, do you have any suggestions for me?

  • #2
    it will provide you with a good estimate of the mean effects, but don't predict.

    Comment


    • #3
      Thank you, Ford. So, in this scenario, we don’t have a Stata command for prediction?

      Comment


      • #4
        Help me, please. If my dependent variable is, for example, 1 = currently employed and 0 = not employed, and my independent variable is mental health, which can be discrete or continuous, how should I interpret a result of 0.5 after using ivreg2h?


        Thank you for your help.

        Comment


        • #5
          Laurence:
          why not posting what you typed and what Stata gave you back (as per FAQ)?
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Just like linear regression.

            what I mean by don’t predict is that LPM may predict outside the unit interval.

            Comment


            • #7
              Interpret just like linear regression.

              what I mean by don’t predict is that LPM may predict outside the unit interval.

              Comment


              • #8
                Originally posted by George Ford View Post
                it will provide you with a good estimate of the mean effects, but don't predict.
                Is that true? If you use linear regression with an indicator variable as the dependent variable, then your errors will be heteroskedastic. If at the same time you argue that the endogeneity cause heteroskedasticity and you use that heteroskedasticity for identification, then that sounds problematic to me. Part of the heteroskedasticity you observe is not due to endogeneity but due to the binary nature of the depedent variable.
                ---------------------------------
                Maarten L. Buis
                University of Konstanz
                Department of history and sociology
                box 40
                78457 Konstanz
                Germany
                http://www.maartenbuis.nl
                ---------------------------------

                Comment


                • #9
                  Interesting question, Maarten.

                  Comment


                  • #10
                    On second thought, I think it's fine. the hetero part is not based on y, but the endogenous X. I'd think you'd want to bootstrap across the models.

                    Code:
                    sysuse auto, clear
                    
                    ** Main Model
                    eststo e1: ivreg2h foreign weight length (mpg =)
                    
                    ** Let's replicate by hand
                    reg mpg weight length // Y not part of this
                    predict cf , res
                    center weight length
                    g c_weight_cf = c_weight*cf
                    g c_length_cf = c_length*cf
                    reg mpg weight length c_weight_cf c_length_cf
                    predict mpg_hat
                    predict cf_y2 , res
                    
                    eststo e2: reg foreign mpg_hat weight length
                    eststo e3: ivreg2 foreign weight length (mpg = c_weight_cf c_length_cf)
                    esttab e1 e2 e3
                    
                    ivprobit foreign weight length (mpg = c_weight_cf c_length_cf)
                    Last edited by George Ford; 17 Feb 2025, 08:48.

                    Comment


                    • #11
                      Code:
                      sysuse auto, clear
                      
                      ** Main Model
                      eststo e1: ivreg2h foreign weight length (mpg =)
                      
                      ** Let's replicate by hand
                      reg mpg weight length
                      predict cf , res
                      center weight length
                      g c_weight_cf = c_weight*cf
                      g c_length_cf = c_length*cf
                      reg mpg weight length c_weight_cf c_length_cf
                      predict mpg_hat
                      predict cf_y2 , res
                      
                      eststo e2: reg foreign mpg_hat weight length
                      eststo e3: ivreg2 foreign weight length (mpg = c_weight_cf c_length_cf)
                      eststo e4: probit foreign mpg weight length cf_y2
                      margins, dydx(mpg)
                      esttab e1 e2 e3 e4
                      
                      eststo e5: ivprobit foreign weight length (mpg = c_weight_cf c_length_cf)
                      eststo e6: probit foreign mpg_hat weight length
                      
                      esttab e1 e2 e3 e4 e5 e6
                      
                      estimates restore e6
                      margins, dydx(mpg_hat) atmeans
                      model e6 seems to get you very close.

                      Comment


                      • #12
                        Maybe the best option as it computes SE across both models, but the margins are not close to the LPM variant (I don't know why, but I'm sure there's an explanation or else the margins need to be computed differently).

                        Code:
                        ** CFPROBIT
                        eststo e7: cfprobit foreign weight length (mpg = c_weight_cf c_length_cf)
                        margins, predict(pr) dydx(mpg) atmeans
                        esttab e1 e2 e3 e4 e5 e6 e7

                        Comment


                        • #13
                          a fix.

                          Code:
                          eststo e5: ivprobit foreign weight length (mpg = c_weight_cf c_length_cf)
                          margins, at(mpg = (21 21.1)) atmeans post
                          di e(b)[1,2] - e(b)[1,1]
                          lincom 1._at - 2._at
                          Last edited by George Ford; 17 Feb 2025, 09:28.

                          Comment


                          • #14
                            I find this interesting, and can't explain.

                            Normally, LPM gives a good estimate of the marginal effect. This is confirmed.

                            When you move to IV, it doesn't.

                            Code:
                            sysuse auto, clear
                            estimates clear
                            
                            ** Check to see if LPM gives good AME estimate
                            regress foreign weight length mpg
                            local b_mpg = _b[mpg]
                            probit foreign weight length mpg
                            margins, dydx(mpg)  post
                            di "LPM = " %6.4f `b_mpg'
                            di "PRO = " %6.4f e(b)[1,1]
                            
                            ** NOW TURN TO IV
                            ** ivreg2h, LPM Model (first stage excludes Y), generate instruments
                            ivreg2h foreign weight length (mpg = ) , gen(inst_, replace) robust
                            ** use generated instruments in ivreg2
                            ivreg2 foreign weight length (mpg = inst*) , robust
                            local b_mpg = _b[mpg]
                            ** use generated instruments in ivprobit
                            ivprobit foreign weight length (mpg = inst*) , vce(robust) first
                            margins, dydx(mpg) predict(pr fix(mpg)) post
                            di "LPM = " %6.4f `b_mpg'
                            di "PRO = " %6.4f e(b)[1,1]
                            
                            ** Create Prediction of IV
                            reg mpg weight length inst*, robust
                            capture drop mpgf
                            predict mpgf 
                            correl mpg mpgf
                            regress foreign weight length mpgf, robust
                            local b_mpg = _b[mpgf]
                            probit  foreign weight length mpgf, robust
                            margins, dydx(mpgf) post
                            di "LPM = " %6.4f `b_mpg'
                            di "PRO = " %6.4f e(b)[1,1]

                            Comment

                            Working...
                            X