Announcement

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

  • Problems in bootstrapping Data Envelopment Analysis (DEA) results

    Hi all,

    I'm using DEA in Stata to compute public expenditure efficiency frontiers across a sample of 34 countries. The command's syntax is the following:

    dea env tot_hexpav = le, rts(vrs)

    where left-hand variables env & tot_hexpav [an environment composite indicator and total health expenditure] are input and le [life expectancy] is output.
    The command is for the input-orientation and assumes variable returns to scale (vrs). The dea command just returns a matrix where all results are saved: r(dearslt).
    Now, I would like to bootstrap the efficiency scores obtained from dea, which are the second column of the r(dearslt) matrix by - in simple terms - the following Stata command:


    bootstrap **XXXX**, rep(200) : dea env tot_hexpav = le, rts(vrs)

    My question is...how should I shape the "exp_list" XXXX to tell Stata to bootstrap the second column of the matrix of results from dea after :? I have tried various combinations, but without success. Has someone else faced the same problem or have an idea as to how to circumvent it? The DEA command can be found in Stata Journal Volume 10, Number 2 (st0193). I also attach a txt file with input data.

    Your help would be much appreciated.

    Patrizio

    Attached Files

  • #2
    Would also appreciate some help on a similar issue

    Comment


    • #3
      Would also appreciate some help on a similar issue

      Comment


      • #4
        So here is what I did, adapted from
        http://www.ats.ucla.edu/stat/stata/faq/ownboot.htm

        Without being able to return a matrix, I went through all parameters and returned them as scalars. Probably not the best way, I guess there is a shorter one (I have 25 countries and have to write them down)

        Note that my output is the result of a PCA on several output measures:
        Code:
        score
        ..and my input is
        Code:
        liss_DIRDA_civile
        Code:
        *Step 1
        capture program drop manualboot_init
        program define manualboot_init, rclass
        quietly dea liss_DIRDA_civile = score, ort(o)
            mat deascores = r(dearslt)
            mat deascores = deascores[1...,"theta"]
            svmat deascores
            egen deascores_st=std(deascores)
            replace deascores_st=-deascores_st
            mkmat deascores_st
            mat deascores_st=deascores_st'
            foreach i of numlist 1/25{
            return scalar score_`i'=deascores_st[1,`i']
            }
            end
        manualboot_init
        matrix deascores_st = (r(score_1), r(score_2), r(score_3), r(score_4), r(score_5), r(score_6), r(score_7), r(score_8), ///
        r(score_9), r(score_10), r(score_11), r(score_12), r(score_13), r(score_14), r(score_15), r(score_16), r(score_17), ///
        r(score_18), r(score_19), r(score_20), r(score_21), r(score_22), r(score_23), r(score_24), r(score_25))
        
        *Step 2
        capture program drop manualboot
        program define manualboot, rclass
         preserve
          bsample 25
            dea liss_DIRDA_civile = score, ort(o)
            mat deascores2 = r(dearslt)
            mat deascores2 = deascores2[1...,"theta"]
            svmat deascores2
            egen deascores2_st=std(deascores2)
            replace deascores2_st=-deascores2_st
            mkmat deascores2_st
            mat deascores2_st=deascores2_st'
            *return matrix dea = deascores2
            foreach i of numlist 1/25{
            return scalar score_`i'=deascores2_st[1,`i']
            }
         restore
        end
        
        *Step 3 // use the simulate prefix command along with myboot to collect stats from the bootstrapped sample.
        #delimit ;
        simulate score_1=r(score_1) score_2=r(score_2) score_3=r(score_3) score_4=r(score_4) score_5=r(score_5) score_6=r(score_6) score_7=r(score_7) score_8=r(score_8)
        score_9=r(score_9) score_10=r(score_10) score_11=r(score_11) score_12=r(score_12) score_13=r(score_13) score_14=r(score_14) score_15=r(score_15) score_16=r(score_16) score_17=r(score_17)
        score_18=r(score_18) score_19=r(score_19) score_20=r(score_20) score_21=r(score_21) score_22=r(score_22) score_23=r(score_23) score_24=r(score_24) score_25=r(score_25),
         reps(100) seed(12345): manualboot ;
        #delimit cr
        bstat, stat(deascores_st) n(300)
        estat bootstrap, all
        Hope it helps

        Last edited by Axel Demenet; 04 Jan 2017, 01:37.

        Comment


        • #5
          Besides being ugly, the above code is probably wrong; the intuiton is that there is no guarantee that country _N will systematically return the scalar score_N, because the nature of bootstrap is to draw with replacement - and thus mix each country's position.
          Any thought on this?

          Comment


          • #6
            Followig up : without any more insight, I would recommend switching to R for bootstraping, as all of these routines have been programmed.
            shouldn't be more difficult than this:

            Code:
            # library(FEAR)
            library(FactoMineR)
            library(Benchmarking)
            library(ggplot2)
            library(scales)
            
            donnees <- read.csv2("base_boot.csv",na.strings="")
            y <- as.matrix(donnees$output)
            x <- as.matrix(donnees$input)
            
            e.boot <- dea.boot(x,y,NREP = 3000,ORIENTATION="out",RTS = "vrs")
            e.boot$eff
            write.table(e.boot$eff,"eff.csv",sep=";",dec=",")
            e.boot$eff.bc
            write.table(e.boot$eff.bc,"eff_bc.csv",sep=";",dec=",")
            e.boot$conf.int
            write.table(e.boot$conf.int,"eff_ic.csv",sep=";",dec=",")

            Comment

            Working...
            X