2.3.1 Data Envelopment Analysis (deamod)

Run LPL Code  ,  PDF Document


Data Envelopment Analysis (DEA) is a method in economics to empirically measure, evaluate and compare the efficiency of decision making units (or DMUs). Each DMU is evaluated on the basis of various input and output data (“less input and more output is better”) (see [6] for more information). In this example, the efficiency of six high schools is compared: Bloom (BL), Homewood (HW), New Trier (NT), Oak Park (OP), York (YK), and Elgin (EL). The input factors are “spending per pupil” and “not low income” (COST RICH), the output factors are “Writing score” and “Science score” (WRIT SCIN). Which schools are most efficient? The example is from [5].

Modeling Steps

Let the set of schools be i,k I and the (input/output) factors j J (the first two factors J1 are input the others are output factors J2 (with J1 J2 = J). The input/output data are collected in the matrix Fi,j. The variables are the scores of each DMU (SCOREi) and the weights Wi,j.

  1. The sum of the scores is to be maximized:

max      SCORE
  2. The score of a DMU is the weighted output:

SCOREi    =     Fi,jWi,j   forall i ∈ I
  3. The input of each DMU is normalized to 1 :

    Fi,jWi,j = 1   forall i ∈ I
  4. The output divided by the input on each DMU against each other must be smaller than 1:

    ∑              ∑
    F   W   ≤      F   W     forall i,k ∈ I
   2  k,j  i,j      1 k,j  i,j
j∈J            j∈J


The scores of the schools are:

  Score of BL : 1.000
  Score of HW : 0.910
  Score of NT : 0.962
  Score of OP : 0.912
  Score of YK : 1.000
  Score of EL : 1.000

Hence, the most efficient schools are Bloom, Yorktown, and Elgin.

Further Comments

In LINGO, the syntax begins with MODEL and ends with END but they seemed to have no special functions besides to indicate the beginning or ending of the code. In LPL, by contrast, they are important because in this way one can modularize the code into multiple “sub-models”. LINGO’s syntax clear departs from the usual mathematical notation: Instead of SUM(J IN FACTOR)... it is @SUM(FACTOR(J)...) Equality and assignment operators are the same. Furthermore, it does not distinguish syntactically between active and passive indices (see my Indexing Paper for more information) – this is also the case, by the way, for GAMS. I find it essential to distinguish them syntactically, it sharpens the preciseness when creating and building models.

LPL code (run deamod)

model deamod "Data Envelopement Analysis"; 
  set DMU,i,k := [BL HW NT OP YK EL] "Six schools"; 
    FACTOR,j := [COST RICH WRIT SCIN] "input/output factors"; 
    // Inputs are "spending/pupil" and "not low income" 
    // Outputs are "Writing score" and "Science score" 
    NINPUTS := 2 "The first NINPUTS factors are inputs"; 
    F{i,j} := [89.39  64.3     25.2   223 
               86.25  99       28.2   287 
              108.13  99.6     29.4   317 
              106.38  96       26.4   291 
               62.40  96.2     27.2   295 
               47.19  79.9     25.5   222]; 
    WGTMIN := .0005 "Min weight applied to every factor"; 
  variable W{i,j} [WGTMIN..9999999] "weight"; 
  maximize SC: sum{i} SCORE[i]; 
    A{i}: SCORE[i] = sum{j|j>NINPUTS} F[i,j]*W[i,j]; 
    B{i}: sum{j|j<=NINPUTS} F[i,j]*W[i,j] = 1; 
    C{i,k}: sum{j|j>NINPUTS} F[k,j]*W[i,j] <= 
            sum{j|j<=NINPUTS} F[k,j]*W[i,j]; 
  Write{i}('Score of %s : %5.3f' n', i, SCORE); 
  Write(' %7s' n',{j} j); 
  Write{i}('%3s %7.4f' n', i, {j} W); 

LINGO code (download deamod.lng)

! Data Envelopement Analysis (DEAMOD.LNG); 
  DMU/BL HW NT OP YK EL/: ! Six schools; 
         SCORE; ! Each decision making unit has a; 
                ! score to be computed; 
! There is a set of factors, input & output; 
DXF(DMU, FACTOR):F, !F( I, J) = Jth factor of DMU I; 
           W; !Weights used computing DMU I's score; 
  NINPUTS = 2;  ! The first NINPUTS are inputs; 
!      The inputs,    the outputs; 
  F  =  89.39  64.3     25.2   223 
        86.25  99       28.2   287 
       108.13  99.6     29.4   317 
       106.38  96       26.4   291 
        62.40  96.2     27.2   295 
        47.19  79.9     25.5   222; 
WGTMIN = .0005; ! Min weight applied to every factor 
!The Model. Everyone's score as high as possible; 
@FOR( DMU( I): 
SCORE( I) = 
 @SUM(FACTOR(J)|J #LE# NINPUTS: F(I, J)* W(I, J))=1; 
@FOR( DMU( K): 
 @SUM(FACTOR(J)|J #GT# NINPUTS: F(K, J) * W(I, J))<= 
  @SUM(FACTOR(J)|J #LE# NINPUTS: F(K, J) * W(I, J)); 
@FOR(DXF(I, J):  @BND(WGTMIN, W(I, J), 9999999););