Professional Documents
Culture Documents
Paper 274-25
efficient iff h*=1 and the optimal values of Si- & Sr+ are zero for all with SAS can add their own features to build other DEA models.
i & r1. This means no other DMU or combination of DMUs exist Users not familiar with SAS need only to run the program with
which can produce at least the same amount of output as DMU j0, their model specification prior running the system.
with less for some resources and/or no more for any other The SAS/DEA requires two initial data sets that contain the input
resources. and output variables for observed units. The data describing
In Model (1), Si and Sr represent slack variables. Thus a slack in inputs/outputs must be presented in the format that variables
an input i, i.e. Si* > 0, represents an additional inefficiency use of appear in columns and units in rows and saved as .txt file (Tab
input i. A slack in an output r, i.e. Sr* > 0, represents an additional delimited). The program has the ability to accommodate unlimited
inefficiency in the production of output r. number of inputs/outputs with unlimited number of DMUs. The
The DEA Model (1) is known as output - oriented model because only limitation is the memory of computer used to run the
it expands output of DMU j0 within the production space. It should SAS/DEA.
be solved n times once for each DMU being evaluated to The SAS/DEA software then converts data sets to a DEA model
generate n optimal values of (h*, λ*). selected. Based on the data and parameters specified in the
For DMU j0 SAS/DEA, the code first create the usual linear program then it
If radial expansion is possible Model (1) will yield h*j0 >1, use "Proc LP" to solve the model. Results then will be transferred
If radial expansion is not possible Model (1) will yield h*j0 =1. to report files.
The SAS/DEA produces a table of efficiencies of DMUs. It also
The positive elements of the optimal values in λ identify the set of
supplies much other valuable information including lambdas in
dominating DMUs located on the constructed production frontier,
primal and weights in dual DEA models. These information are
against which the DMU j0 is evaluated. This subset of DMUs is
very useful for analysing the inefficient units, where the source of
called “peers” to DMU j06. From Model (1) it is clear that the model
inefficiency comes from and how could improve an inefficient unit
defines the relative efficiency of a DMU in terms of output
to the desired level.
maximisation. The input oriented model of DEA can be defined in
a similar way. Figure (1) illustrates the data flow in the SAS/DEA. It shows
• the input and output variables data sets that are required
for SAS/DEA.
Model 2. Input oriented - CRS model • the parameters that SAS/DEA needs to define the model.
• The macros; (%data, %model and %report) and
Min φ • the result data sets that are available for print or can be
used for further analysis.
s.t.
DATA SAS/DEA RESULT
åλ x
j
j ij + S+i = φx ij 0 ∀i
Report1
å λ jy rj − S-r = y rj
Input (primal
0
∀r variables
data file Parameters
mode)l
Report2
j (dual
model)
length unitname $ 50 ;
input unitname $
Table 1. The terms used for defining parameters in SAS/DEA NXarray(*) $ ;
if _n_ eq 1 then output;
Parameter Meaning drop unitname;
_InpData Specifies the file name of input variables run;
_NoInut Specifies the number of the input variables in
the optimisation DEA model data AX;
infile &_InData delimiter='09'X missover
_OutData Specifies the file name of output variables
dsd ;
_NoOutput Specifies the number of the output variables in array AXarray(&_nInput) AX1-AX&_nInput;
the optimisation DEA model length unitname $ 50 ;
_Orienta This parameter is used to specify the input unitname $
orientation of the DEA model to be solved. AXarray(*) ;
"InputMin" for input minimisation model and if _n_ gt 1 then output;
"OutputMax" for output maximisation model call symput('_nDmu',_n_-1);
run;
The SAS/DEA runs three macros for data handling (%data),
model building (%model) and report writing (%report). data DMUs;
set AY (keep=UnitName);
DATA HANDLING (%DATA) Uj0=_n_;
This part of SAS/DEA reformats the data to a suitable format that run;
can be used in SAS/OR. The SAS/DEA requires two data sets %mend data;
including input and output variables. Both data sets need to be
“.txt” files saved as “text tab delimited”. Variables must be MODEL BUILDING (%MODEL)
presented in columns and units in rows. The unit names must This part of SAS/DEA builds the requested DEA model in the
start with a letter and may contain up to 50 characters and must format suitable for SAS/OR and for purpose of calling "Proc LP".
be listed in the first column of the data file. The other columns are There is one parameter prior calling the procedures:
including numeric values of variables. These variables can be _Orienta
entered into the file in any order. The first row of the data file For example, for solving a standard input minimisation model the
represents the name of the variables. An example of data file for user should set the parameters to:
input variables is: _Orienta=InputMin;
and for solving output maximisation model the user should set the
Unit Input1 Input2 parameters to:
DMU1 10 20 _Orienta=OutputMax;
SAS procedure for model building is as follows.
DMU2 30 15
DMU3 15 40 %macro model;
%local i j j0;
The data file for output variable has similar format. data MODEL1;
There are four parameters prior to calling the data macro: %let _nUnit=&_nDmu;
_InpData, _NoInput, _OutData, _NoOutput. array NYarray(&_nOutput)$ NY1-NY&_nOutput ;
The purpose of each parameter is presented in Table 1. array AYarray(&_nOutput) AY1-AY&_nOutput;
SAS procedure for data handling is as follows. array NXarray(&_nInput) $ NX1-NX&_NInput ;
array AXarray(&_nInput) AX1-AX&_nInput;
%macro data; array Jarray(&_nUnit) U1-U&_nUnit ;
data NY;
infile &_OutData delimiter='09'X missover length _row_ $ 50 _col_ $ 50 _type_ $ 8 ;
dsd ; keep _row_ _col_ _type_
array NYarray(&_nOutput) $ NY1- _coef_ ;
NY&_nOutput ;
length unitname $ 50 ; J0=&jj; /* Jo is unit under assessment*/
input unitname $ if &_Orienta='InputMin' then do;
NYarray(*) $ ; _type_='MIN';
if _n_ eq 1 then output ; _row_ ='OBJ';
drop unitname; _col_='.';
run; _coef_=.;
output;
data AY DMUs; _type_='.';
infile &_OutData delimiter='09'X missover _row_ ='OBJ';
dsd; _col_ ='FI';
array AYarray(&_nOutput) AY1-AY&_nOutput; _coef_=1;
length unitname $ 50 ; output;
input unitname $ _type_='.';
AYarray(*) ; _row_ ='OBJ';
if _n_ gt 1 then output ; _col_='_rhs_';
run; _coef_=0;
output;
data NX; end;
infile &_InData delimiter='09'X missover link ReadNX;
dsd ; do j= 1 to &_nUnit;
array NXarray(&_nInput)$ NX1-NX&_NInput ; link ReadAX;
Statistics and Data Analysis
do i= 1 to &_nInput; _type_='.';
_col_='LA' || put(j,3.); _coef_=AYarray(r);
_row_=NXarray(i); output;
_type_='.'; if j=J0 then do;
_coef_=AXarray(i); select(&_Orienta);
output; when('InputMin') do;
if j=J0 then do; _col_='_rhs_';
select(&_Orienta); _row_=NYarray(r);
when('InputMin') do; _type_='GE';
_row_=NXarray(i); _coef_=AYarray(r);
_type_='.'; output;
_coef_=-AXarray(i); end;
_col_='FI'; when('OutputMax') do;
output; _col_='FI';
_col_='_rhs_'; _row_=NYarray(r);
_row_=NXarray(i); _type_='.';
_type_='LE'; *LE; _coef_=-AYarray(r);
_coef_=0; output;
output; _col_='_rhs_';
end; _row_=NYarray(r);
when('OutputMax') do; _type_='GE';
_row_=NXarray(i); _coef_=0;
_type_='LE'; output;
_coef_=AXarray(i); end;
_col_='_rhs_'; otherwise;
output; end;
end; end;
otherwise; end;
end; end;
end; ReadNY: set NY; return;
end; ReadAY: set AY; return;
end; run;
ReadNX: set NX; return; data MODEL; set MODEL1 MODEL2 ; run;
ReadAX: set AX; return; %mend model ;
run;
SAS/DEA REPORT WRITING (%REPORT)
The SAS/DEA results are including table of efficiencies of DMUs
data MODEL2; in two formats sorted by the most efficient DMU and sorted
%let _nUnit=&_nDmu; alphabetically by the name of DMUs. All other information like
array NYarray(&_nOutput)$ NY1-NY&_nOutput ; slacks and lambdas in model (1 or 2) are saved in file "Report1".
array AYarray(&_nOutput) AY1-AY&_nOutput; All information on the dual to model (1 or 2) including weights are
array NXarray(&_nInput) $ NX1-NX&_NInput ; saved in file "Report2".
array AXarray(&_nInput) AX1-AX&_nInput; SAS procedure for report writing is as follows.
array Jarray(&_nUnit) U1-U&_nUnit ; %macro report;
data eff(drop=Uj0);
length _row_ $ 50 _col_ $ 50 _type_ $ 8 ; merge DMUs Eff;
keep _row_ _col_ _type_ _coef_ ; by Uj0;
run;
J0=&jj; * Jo is unit under assessment; proc sort data=Eff; by eff; run;
if &_Orienta='OutputMax' then do; proc print data=Eff; run;
_type_='MAX'; proc sort data=Eff; by UnitName; run;
_row_ ='OBJ'; proc print data=Eff; run;
_col_='.'; %mend report;
_coef_=.; SAS/DEA MACRO
output;
To make the system as ease as possible the “%sasdea macro”
_type_='.';
put all the above code together.
_row_ ='OBJ';
%macro sasdea;
_col_ ='FI';
libname sasdea 'C:\sasdea';
_coef_=1;
proc datasets nolist; delete Eff Report1
output; report2; run;
_type_='.'; %data;
_row_ ='OBJ'; %let _nUnit=&_nDmu;
_col_='_rhs_'; %do jj=1 %to &_nUnit;
_coef_=0; %model;
output; proc lp data=MODEL noprint sparsedata
end; primalout=lp2 dualout=lp3 ; run;
link ReadNY; data EffJ0(keep=Uj0 eff); set lp2 (where=
do j= 1 to &_nUnit; (_var_='OBJ')); Uj0=&jj;
link ReadAY; if &_Orienta='OutputMax' and _value_
do r= 1 to &_nOutput; ne 0 then Eff=1/_value_;else Eff=_value_;
_col_='LA' || put(J,3.); run;
_row_=NYarray(r); proc datasets nolist; append base=Eff
Statistics and Data Analysis
data=EffJ0; run; The above code manages to get the result based on the specified
data lp2; set lp2; Uj0=&jj;run; parameters and data files.
proc datasets nolist; append base=Report1
data=lp2;run; SAMPLE RESULTS FROM SAS/DEA
data lp3; set lp3; Uj0=&jj;run; The result of running above code is presented below. The third
proc datasets nolist; append base=Report2 column shows the efficiency score.
data=lp3;run;
%end; The SAS System
%report;
%mend sasdea;
OBS UNITNAME EFF
REFERENCES
1
Charnes, A., W. W. Cooper, and E. Rhodes. (1978), "Measuring
the Efficiency of Decision Making Units," European Journal of
Operations Research 2(6) pp 429-44.
2
SAS Institute Inc. (1989), SAS/OR User’s Guide, Version 6,
First Edition, Cary, NC: SAS Institute Inc.
3
Trevor Kearney (1999), "Advances in Mathematical
Programming and Optimisation in the SAS System," SUGI24
Proceedings, Cary, NC: SAS Institute Inc.
4
Cohen, Marc-david and Phil Meanor (1995), QSIM Application
Discrete Event Queuing Simulation, Release 6.11, Cary, NC:
SAS Institute Inc.
5
SAS Institute Inc. (1993), SAS/OR User’s Guide, Project
Management, Version 6, First Edition, Cary, NC: SAS Institute
Inc.
6
Boussofiane, A, R. Dyson and E Thanassoulis, (1991), "Applied
data envelopment analysis," European Journal of Operational
Research vol. 52, pp. 1-15.
7
Olesen and Petersen (1995), "A presentation of GAMS for
DEA," Computers & Operations Research 23(4) pp 323-339.
8
Hollingsworth, B. (1997), "A review of data envelopment
analysis software," The Economic Journal 107(443) pp 1268-70.
9
Hollingsworth, B. (1999). "Data Envelopment Analysis and
Productivity Analysis: a review of the options," The Economic
Journal 109(456) pp 458-62.
10
Thanassoulis E. and A. Emrouznejad (1998), Warwick DEA
Software, User's Guide, ISBN: 0902610635, Warwick Business
school, Warwick University, UK.
11
Sexton, Thomas R. (1986), "The Methodology of Data
Envelopment Analysis," in Silkman, Richaed H. (Editor)
Measuring Efficiency: An Assessment of Data Envelopment
Analysis. New Directions for Program Evaluation, no 32, San
Francisco: Jossey-Bass, 1986.
ACKNOWLEDGMENTS
The author wishes to express his thanks to John Thompson and