Learn R Programming

Benchmarking (version 0.27)

dea: DEA efficiency

Description

Estimates a DEA frontier and calculates efficiency measures a la Farrell.

Usage

dea(X, Y, RTS="vrs", ORIENTATION="in", XREF=NULL, YREF=NULL,
    FRONT.IDX=NULL, SLACK=FALSE, DUAL=FALSE, DIRECT=NULL, param=NULL,
    TRANSPOSE=FALSE, FAST=FALSE, LP=FALSE, CONTROL=NULL, LPK=NULL)

# S3 method for Farrell print(x, digits=4, ...) # S3 method for Farrell summary(object, digits=4, ...)

Arguments

X

Inputs of firms to be evaluated, a K x m matrix of observations of K firms with m inputs (firm x input). In case TRANSPOSE=TRUE the input matrix is transposed to input x firm.

Y

Outputs of firms to be evaluated, a K x n matrix of observations of K firms with n outputs (firm x input). In case TRANSPOSE=TRUE the output matrix is transposed to output x firm.

RTS

Text string or a number defining the underlying DEA technology / returns to scale assumption.

0

fdh Free disposability hull, no convexity assumption

1

vrs Variable returns to scale, convexity and free disposability

2

drs Decreasing returns to scale, convexity, down-scaling and free disposability

3

crs Constant returns to scale, convexity and free disposability

4

irs Increasing returns to scale, (up-scaling, but not down-scaling), convexity and free disposability

5

irs2 Increasing returns to scale (up-scaling, but not down-scaling), additivity, and free disposability

6

add Additivity (scaling up and down, but only with integers), and free disposability; also known af replicability and free disposability, the free disposability and replicability hull (frh) -- no convexity assumption

7

fdh+ A combination of free disposability and restricted or local constant return to scale

ORIENTATION

Input efficiency "in" (1), output efficiency "out" (2), and graph efficiency "graph" (3). For use with DIRECT, an additional option is "in-out" (0).

XREF

Inputs of the firms determining the technology, defaults to X

YREF

Outputs of the firms determining the technology, defaults to Y

FRONT.IDX

Index for firms determining the technology

SLACK

Calculate slack in a phase II calculation by an intern call of the function slack. Note that the precision for calculating slacks for orientation graph is low.

DUAL

Calculate dual variables, i.e. shadow prices; not calculated for orientation graph as that is not an LP problem.

DIRECT

Directional efficiency, DIRECT is either a scalar, an array, or a matrix with non-negative elements.

If the argument is a scalar, the direction is (1,1,...,1) times the scalar; the value of the efficiency depends on the scalar as well as on the unit of measurements.

If the argument is an array, this is used for the direction for every firm; the length of the array must correspond to the number of inputs and/or outputs depending on the ORIENTATION.

If the argument is a matrix then different directions are used for each firm. The dimensions depends on the ORIENTATION (and TRANSPOSE), the number of firms must correspond to the number of firms in X and Y.

DIRECT must not be used in connection with DIRECTION="graph".

param

Possible parameters. At the moment only used for RTS="fdh+" to set low and high values for restrictions on lambda; see the section details and examples for its use. Future versions might also use param for other purposes.

TRANSPOSE

Input and output matrices are treated as firms times goods matrices for the default value TRANSPOSE=FALSE corresponding to the standard in R for statistical models. When TRUE data matrices are transposed to good times firms matrices as is normally used in LP formulation of the problem.

LP

Only for debugging. If LP=TRUE then input and output for the LP program are written to standard output for each unit.

FAST

Only calculate efficiencies and just return them as a vector, i.e. no lambda or other output. The return when using FAST cannot be used as input for slack and peers.

CONTROL

Possible controls to lpSolveAPI, see the documentation for that package.

Optional parameters for the print and summary methods.

object, x

An object of class Farrell (returned by the function dea) -- R code uses ‘object’ and ‘x’ alternating for generic methods.

digits

digits in printed output, handled by format in print.

LPK

when LPK=k then a mps file is written for firm k; it can be used as input to an alternative LP solver to check the results.

Value

The results are returned in a Farrell object with the following components. The last three components in the list are only part of the object when SLACK=TRUE.

eff

The efficiencies. Note when DIRECT is used then the efficencies are not Farrell efficiencies but rather exces values in DIRECT units of measurement

lambda

The lambdas, i.e. the weight of the peers, for each firm

objval

The objective value as returned from the LP program; normally the same as eff, but for slack it is the the sum of the slacks.

RTS

The return to scale assumption as in the option RTS in the call

ORIENTATION

The efficiency orientation as in the call

TRANSPOSE

As in the call

slack

A logical vector where the component for a firm is TRUE if the sums of slacks for the corresponding firm is positive. Only calculated in dea when option SLACK=TRUE

sum

A vector with sums of the slacks for each firm. Only calculated in dea when option SLACK=TRUE

sx

A matrix for input slacks for each firm, only calculated if the option SLACK is TRUE or returned from the method slack

sy

A matrix for output slack, see sx

ux

Dual variable for input, only calculated if DUAL is TRUE.

vy

Dual variable for output, only calculated if DUAL is TRUE.

Details

The return from dea and sdea is an object of class Farrell. The efficiency in dea is calculated by the LP method in the package lpSolveAPI. Slacks can be calculated either in the call of dea using the option SLACK=TRUE or in a following call to the function slack.

The directional efficiency when the argument DIRECT is used, depends on the unit of measurement and is not restricted to be less than 1 (or greater than 1 for output efficiency) and is therefore completely different from the Farrell efficiency.

The crs factor in RTS="fdh+" that sets the lower and upper bound can be changed by the argument param that will set the lower and upper bound to 1-param and 1+param; the default value is param=.15. The value must be greater than or equal to 0 and strictly less than 1. A value of 0 corresponds to RTS="fdh". To get an asymmetric interval set param to a 2 dimentional array with values for the low and high end for interval, for instance param=c(.8,1.15). The FDH+ technology set is described in Bogetoft and Otto (2011) pages 73--74.

The technology RTS="vrs+" uses the parameter param to set restrictions on lambda, the convexity parameters. The elements of param are param=(low, high, sum_low, sum_high) where "low" and "high" are restrictions on the individual lambda and "sum_low" and "sum_high" are restrictions on the sum of lambdas. The individual lambda must be in the interval from low to high or be zero. With one parameter the restrictions set are (param, 1+1-(param),1,1), with two parameters (param[1], param[2],1,1), and with four parameters (param[1], param[2],param[3], param[4]). The resulting technology set is not necessarily convex.

The graph orientated efficiency is calculated by bisection between feasible and infeasible values of G. The precision in the result is less than for the other orientations.

When the argument DIRECT=d is used then the returned value e for input orientation is the exces input measured in d units of measurements, i.e. \(x-e d\), and for output orientation \(y+e d\). The directional efficency can be restricted to inputs (ORIENTAION="in"), restricted to outputs (ORIENTAION="out"), or both include inputs and output directions (ORIENTAION="in-out"). Dirctional efficiency is discussed on pages 31--35 and 121--127 in Bogetoft and Otto (2011).

References

Peter Bogetoft and Lars Otto; Benchmarking with DEA, SFA, and R; Springer 2011

See Also

Paul W. Wilson (2008), “FEAR 1.0: A Software Package for Frontier Efficiency Analysis with R,” Socio-Economic Planning Sciences 42, 247--254

Examples

Run this code
# NOT RUN {
x <- matrix(c(100,200,300,500,100,200,600),ncol=1)
y <- matrix(c(75,100,300,400,25,50,400),ncol=1)
dea.plot.frontier(x,y,txt=TRUE)

e <- dea(x,y)
eff(e)
print(e)
summary(e)
lambda(e)

# Input savings potential for each firm
(1-eff(e)) * x
(1-e$eff) * x

# calculate slacks
el <- dea(x,y,SLACK=TRUE)
data.frame(e$eff,el$eff,el$slack,el$sx,el$sy)

# Fully efficient units, eff==1 and no slack
which(eff(e) == 1 & !el$slack)

# fdh+ with limits in the interval [.7, 1.2]
dea(x,y,RTS="fdh+", param=c(.7,1.2))
# }

Run the code above in your browser using DataLab