Announcement

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

  • DEA results graphic

    Hello, I am completing a Data Envelopment Analysis in Stata and want to graph the results and overlay the production frontier. Could you please provide some guidance on how I can go about doing this?

    ​I am actually enrolled in the NetCourse 120/Statistical Graphics for Stata, but the instructors are unresponsive and/or do not know how do create this type of graphic.

    Thanks, Robert

  • #2
    It is one example:


    Code:
    clear
    input str2 firm dmu q x1 x2 
    "A" 1 1 2 5 2 
    "B" 2 2 2 4 1 
    "C" 3 3 6 6 2 
    "D" 4 1 3 2 3 
    "E" 5 2 6 2 3 
    end
    dea x1 x2 = q
    
    gen x1q = x1/q
    gen x2q = x2/q
    mat theta = results[1...,2]
    svmat theta
    gen FrontierX1 = theta*x1q
    gen FrontierX2 = theta*x2q
    
    twoway  line FrontierX2 FrontierX1, mc(black) lc(gs9) lw(thick) mlabv(firm) /// 
    /* Extend lines of frontier*/  ///
    || scatteri 1 3 1 5, recast(line) lc(gs10) lw(thick) ///
    || scatteri 2.5 1 5 1, recast(line) lc(gs10) lw(thick) /// 
    /*Scatter DMU */ /// 
    || scatter x2q x1q , xlabel(0(1)5) ylabel(0(1)5) mc(black) /// 
     mlab(firm) mlabcolor(black) mlabpos(2) ///
    /* Farrell measure of technical efficiency */ ///
    || scatteri 0 0 5 2, ms(.) recast(line) lp(dash) lc(black) ///
    || scatteri 0 0 2 2, ms(.) recast(line) lp(dash) lc(black) /// 
    || scatteri 0 0 2 3, ms(.) recast(line) lp(dash) lc(black) /// 
    || scatteri 1.666 1.6666 "C'" , mlabcolor(black) mc(black) ms(Oh) msize(medlarge) ///
    || scatteri 2.5 1 "A'", mlabcolor(black) mc(black) ms(Oh) msize(medlarge) /// 
    || scatteri 1.429 2.142  "D'", mlabcolor(black) mc(black) ms(Oh) msize(medlarge) /// 
     || ,legend(off) ylabel(,angle(0)) xlabel(,grid) ///
    title(CRS Input Orientated DEA Example) xtitle(X{subscript:1}/Q) ///
    ytitle(X{subscript:2}/Q)  note("Note, firm A has input slack")
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	23.6 KB
ID:	1351392

    Comment


    • #3
      Hello Scott- this is GREAT! I am getting stuck on mat theta, however:


      . mat theta = results[1...,2]
      results not found
      r(111)

      ​I am thinking that there must be some kind of storage issue with my results, but can't figure it out.

      Robert

      Comment


      • #4
        I dropped the line saving the returned results from dea:

        Code:
        mat results = r(dearslt)
        which should come before the mat theta = results[1...,2]

        Comment


        • #5
          DEAgraph.gph

          Thanks a ton! I was able to produce the attached graph which is fairly close to your example. Much appreciated.

          Robert

          Comment


          • #6
            Thanks a lot for this Robert and Scott. I get somehow stuck at Extend lines of frontier and cannot proceed further. Error details copied below!!
            scatteri 1 3 1 5, recast(line) lc(gs10) lw(thick) unrecognized command: scatteri r(199); Any idea of what I am doing wrong? Marisa

            Comment


            • #7
              Marisa Foraci, I have the same problem with the graph, can anyone give us a hint how to do it? Thank you in advance.

              Comment


              • #8
                I feel like you already know it. Just type twoway scatteri ....
                Also, do you guys know how do I get the final plot?

                Comment


                • #9
                  Hello Scott Merryman, sorry for the inconvenience, I want to ask you what varies in a DEA graphic with two inputs and three outputs?

                  Comment


                  • #10
                    Taking the example that you gave to Robert Kolesar

                    Comment


                    • #11
                      I did your example without problems
                      Attached Files

                      Comment


                      • #12
                        Nel Schmidt Cornejo, I do not know how you would graphically depict three outputs and two inputs in such a graph

                        Comment


                        • #13
                          Just a small question. How would you go about visualizing if there is one input?

                          Comment


                          • #14
                            You could show the ratio of input1 to output1 on the y-axis and the ratio of input1 to output2 on the x-axis. If you need to show more than 2 outputs in the graph then you could aggregate similar units using weights (prices, relative prices, etc...) and plot input1 on the y-axis and the aggregate outputs on the x-axis.
                            Last edited by Robert Kolesar; 22 Dec 2022, 04:56.

                            Comment

                            Working...
                            X