Announcement

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

  • Bootstrap standard errors for a two step model and multiply imputed data

    Dear all,

    I am trying to account for sample selection into the selection of female and male wealth. I do that in a two step model. In the first step, I run a probit model and compute the inverse Mills ratio. In the step I incorporate that ratio in my regression. However, I want to bootstrap the aforementioned process in order to have correct estimates. The problem is that I have multiply imputed data (5 times) and even with reps(2) the whole estimation takes age.

    I have written the following code and I would like to know if you think it is correctly coded or if you could provide me with some better suggestions on how to approach such problem.

    capture program drop qr11a
    program define qr11a, rclass
    mi estimate, saving(miest,replace) post dots vceok: svy: probit prob1 gender Dage Dage1 Dchild Rown RownI childI /*
    */ Dmar DmarI DmarII marI marII marIII ageI ageII earningsD earningsI if ra0300<61
    drop xb_mi phi PHI lambda
    mi predict xb_mi using miest
    * To calculate the standard normal pdf
    g phi=normalden(xb_mi)
    * To calculate the standard normal cdf
    g PHI=normal(xb_mi)
    * and to calculate lambda
    g lambda=phi/PHI
    mi estimate, post dots vceok: svy: reg nwealtht gender lambda if partner==0 & ra0300<61
    return scalar b_g = el(e(b_mi),1,1)
    return scalar b_l = el(e(b_mi),1,2)
    end
    bootstrap b_gender=r(b_g) b_lambda=r(b_l), reps(2) : qr11a

    vceok is a command that takes into account the replicate weights of the survey.

    Thank you for your help.

    Ilias

  • #2
    maybe this code is the proper one?


    capture program drop qr11a
    program define qr11a, rclass
    bootstrap, reps(500): probit prob1 gender Dage Dage1 Dchild Rown RownI childI /*
    */ Dmar DmarI DmarII marI marII marIII ageI ageII earningsD earningsI if ra0300<61
    predict xb1, xb
    * To calculate the standard normal pdf
    g phi=normalden(xb1)
    * To calculate the standard normal cdf
    g PHI=normal(xb1)
    * and to calculate lambda
    g lambda=phi/PHI
    bootstrap, reps(500): reg nwealtht gender lambda if partner==0 & ra0300<61
    matrix bb = e(b)
    scalar b_g=(bb[1,1])
    return scalar b_g=bb[1,1]
    scalar b_l=(bb[1,2])
    return scalar b_l=bb[1,2]
    drop phi PHI lambda
    end
    mi estimate, cmdok vceok: qr11a nwealtht gender lambda if partner==0 & ra0300<61

    Comment


    • #3
      What if I use mi xeq: heckman with twostep? Would that give me robust standard errors?

      Comment


      • #4
        Hi Ilias Geo,
        I think the reason you haven't received an answer yet is because the special scenario you are facing is not often encountered.
        That being said. I would do heckman, ml, instead of the two step. Since you want to include some of the survey design in the process.
        heckman twostep, does not allow for weights.
        That may be your best alternative.
        HTH
        Fernando

        Comment


        • #5
          Hi FernandoRios,

          Thank you very much for your reply and suggestion.

          I was able to find some guidance on how to proceed in similar situations but not for the one that I facing.

          If I could ask you about the following: What if I proceed with calculating a two-step model to obtain the coefficients for the variables that I want to include in my analysis and for the standard errors I just use one of the programs above to obtain just the standard errors? Would that be a fairly robust way to have standards errors corrected for bias?

          BR
          Ilias

          Comment

          Working...
          X