Announcement

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

  • Bootstrap procedure of the Wagstaff decomposition

    Dear Statalisters,
    I have been trying to generate the standard errors of the Erreygers concentration index decomposition by bootstrapping. I have successfully followed the decomposition procedure suggested by "Wagstaff A, Van Doorslaer E, Watanabe N. On decomposing the causes of health sector inequalities with an application to malnutrition inequalities in Vietnam. Journal of econometrics. 2003;112(1):207-23".
    I have tried to write my own bootstrap programme for this but have failed.
    Has anyone attempted to write a bootstrap programme for this?
    Thank you for your time and assistance.

  • #2
    "it failed" does not help us identify the problem. Can you tell us exactly what you have done, exactly what Stata told you in return, and exactly why you think that represents a failure?

    I use exactly a lot; that is because in programming the devil is in the details.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you for your response Maarten. Apologies, my first post was not clear.
      I have never written a STATA programme and this was a first time attempt.
      Unfortunately in my various internet searches and readings i have failed to understand how to write this programme such that i do not have much in terms of commands or data output to share.
      I am hoping someone has a STATA code for this or a step by step procedure that i can follow to do this.

      Comment


      • #4
        Hi all,

        I am having trouble bootstrapping the concentration indices and contributions of explanatory variables that are used to compute the (needs-adjusted) income-related inequality (horizontal inequity) in access to home care.

        The guidelines have provided me with the following code:

        Code:
        *MEASUREMENT OF HORIZONTAL INEQUITY
        
        qui probit y1skc $X $Z [pw=dw_w6], robust
        foreach z of global Z {
        gen copy_`z'=`z'
        qui sum `z' [aw=dw_w6]
        replace `z' = r(mean)
        }
        predict yhat
        foreach z of global Z {
        replace `z' = copy_`z'
        drop copy_`z'
        }
        sum yhat [aw=dw_w6]
        sca m_yhat = r(mean)
        gen yst = y1skc-yhat + r(mean)
        
        
        *EXPLAINING HORIZONTAL EQUITY
        
        *SKILLED CARE
        
        dprobit y1skc $X $Z [pw=dw_w6]
        matrix dfdx=e(dfdx)
        
        sca need=0
        foreach x of global X{
        qui{
            mat b_`x' = dfdx[1,"`x'"]
            sca b_`x' = b_`x'[1,1]
            corr rank `x' [aw=dw_w6], c
            sca cov_`x' = r(cov_12)
            sum `x' [aw=dw_w6]
            sca m_`x' = r(mean)
            sca elas_`x' = (b_`x'*m_`x')/m_yhat
            sca CI_`x' = 2*cov_`x'/m_`x'
            sca con_`x' = elas_`x'*CI_`x'
            sca prcnt_`x' = con_`x'/CI_`x'
            sca need=need+con_`x'
        }
        di "`x' elasticity:", elas_`x'
        di "`x' concentration index:", CI_`x'
        di "`x' contribution:", con_`x'
        di "`x' percentage contribution:", prcnt_`x'
        }
        The command neatly displays the point estimates for the elasticity, concentration index and contribution of each explanatory variable as requested. However, instead of displaying the point estimates, I would like to bootstrap them first (1000 replications) in order to derive statistical inferences. The bootstrap method is "adapted to reflect the stratified sampling design with respect to the primary sampling unit of share".

        I have tried following the example from the following link: https://tutorials.methodsconsultants...he%20statistic.

        It uses bootstrapping a correlation coefficient as an example. Do I understand correctly that in my case, the correlation is substituted by the elasticity, concentration index and contribtution? If so, following this example (see bottom of the page in the link), I think that I'd either need to write an rclass or eclass program for the computation of the statistics to be bootstrapped (elas_`x', CI_`x', con_`x'). I would need to calculate the statistic, store the statistics in a local variable and . I did just this and used
        Code:
        ereturn list
        at the beginning of the last part of the loop to check whether the displayed output was stored somewhere.

        It seemed like the displayed output (including the text) was stored in 'functions':
        Code:
        e(sample)
        , so I thought that this would be the statistic to be bootstrapped. I am struggling to write the program correctly, because it does not (e)return the list when I test the program to the whole dataset. This was the program I wrote after having deleted the display commands:
        Code:
        program define elasticity, eclass
        
        dprobit y1skc $X $Z [pw=dw_w6]
        matrix dfdx=e(dfdx)
        
        sca need=0
        foreach x of global X{
        qui{
            mat b_`x' = dfdx[1,"`x'"]
            sca b_`x' = b_`x'[1,1]
            corr rank `x' [aw=dw_w6], c
            sca cov_`x' = r(cov_12)
            sum `x' [aw=dw_w6]
            sca m_`x' = r(mean)
            sca elas_`x' = (b_`x'*m_`x')/m_yhat
            sca CI_`x' = 2*cov_`x'/m_`x'
            sca con_`x' = elas_`x'*CI_`x'
            sca prcnt_`x' = con_`x'/CI_`x'
            sca need=need+con_`x'
        }
        elas_`x'
        *CI_`x'
        *con_`x'
        }
        end
        Then using
        Code:
        elasticity ereturn list
        doesn't store the statistics in [/CODE]e(sample[/CODE] anymore. I thought this was going to be my end result
        Code:
        bootstrap e(sample), reps(1000)
        .

        Unfortunately, it didn't turn out that way. I also tried the loop provided by a youtube tutorial (https://www.youtube.com/watch?v=_8-2QBL-9UM&t=474s), which I feel would make this message too lengthy. This also led to problems. The main issue is that I am looking for a clever way to bootstrap my indices and contributions and if there is anyway more simple, I'd be very happy to receive some advice or provide more information. Thank you in advance!

        Comment


        • #5
          Hello Siebe,

          Did you get solution bootstrapping the decomposition as I am also trying it.
          Sharing the command is highly appreciated.

          Comment

          Working...
          X