Title: | Nonparametric Methods for Measuring Efficiency and Productivity |
---|---|
Description: | Efficiency and productivity indices are measured using this package. This package contains functions for measuring efficiency and productivity of decision making units (DMUs) under the framework of Data Envelopment Analysis (DEA) and its variations. |
Authors: | Dong-hyun Oh <[email protected]>, Dukrok Suh <[email protected]> |
Maintainer: | Dong-hyun Oh <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.5-13 |
Built: | 2025-03-08 03:30:55 UTC |
Source: | https://github.com/arecibo/nonparaeff |
Solve the Additive Model under the VRS assumption
additive(base = NULL, frontier = NULL, noutput = 1)
additive(base = NULL, frontier = NULL, noutput = 1)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
The additive model under the VRS assumption is as follows:
A data frame with J1*(J1+M+N), which has efficiency scores, optimal weightes and optimal slacks. Take a look at the example below.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
## Simple Example my.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- additive(my.dat, noutput = 1)) ## Property of the Additive Model dat1 <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(2, 3, 6, 3, 6, 6), x2 = c(5, 3, 1, 8, 4, 2)) dat2 <- dat1 dat2$x1 <- dat2$x1 * 10 dat3 <- dat1 dat3$x1 <- dat3$x1 + 10 (re1 <- additive(dat1, noutput = 1)) (re2 <- additive(dat2, noutput = 1)) (re3 <- additive(dat3, noutput = 1))
## Simple Example my.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- additive(my.dat, noutput = 1)) ## Property of the Additive Model dat1 <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(2, 3, 6, 3, 6, 6), x2 = c(5, 3, 1, 8, 4, 2)) dat2 <- dat1 dat2$x1 <- dat2$x1 * 10 dat3 <- dat1 dat3$x1 <- dat3$x1 + 10 (re1 <- additive(dat1, noutput = 1)) (re2 <- additive(dat2, noutput = 1)) (re3 <- additive(dat3, noutput = 1))
Solve the AR-DEA
ar.dual.dea(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1, ar.l = NULL, ar.r = NULL, ar.dir = NULL, dual = FALSE)
ar.dual.dea(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1, ar.l = NULL, ar.r = NULL, ar.dir = NULL, dual = FALSE)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. |
rts |
Returns to scale. 1 for the CRS assumption, and 2 for the VRS assumption. |
ar.l |
A data frame for the assurance region of which is the left-hand. |
ar.r |
A vector for the assurance region of which is the right-hand. |
ar.dir |
A vector for the assurance region of which is the direction. |
dual |
Logical. |
The AR model under the CRS assumption is calculated. For model specification, take a look at Cooper et al. (2007).
A data frame with J1*(M+N), which has efficiency scores, optimal virtual prices. Take a look at the example below.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
## AR constraint of 0.25 <= v2/v1 <= 1. library(Hmisc) library(lpSolve) ar.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(2, 3, 6, 3, 6, 6), x2 = c(5, 3, 1, 8, 4, 2)) (re <- ar.dual.dea(ar.dat, noutput = 1, orientation = 1, rts = 1, ar.l = matrix(c(0, 0, 0.25, -1, -1, 1), nrow = 2, ncol = 3), ar.r = c(0, 0), ar.dir = c("<=", "<=")))
## AR constraint of 0.25 <= v2/v1 <= 1. library(Hmisc) library(lpSolve) ar.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(2, 3, 6, 3, 6, 6), x2 = c(5, 3, 1, 8, 4, 2)) (re <- ar.dual.dea(ar.dat, noutput = 1, orientation = 1, rts = 1, ar.l = matrix(c(0, 0, 0.25, -1, -1, 1), nrow = 2, ncol = 3), ar.r = c(0, 0), ar.dir = c("<=", "<=")))
Solve the Cost Minimization Probem with Given Input Prices
cost.dea(base = NULL, frontier = NULL, noutput = 1, input.price = NULL)
cost.dea(base = NULL, frontier = NULL, noutput = 1, input.price = NULL)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (M). |
input.price |
A vector for market prices of input factors. |
The cost minimization problem under the CRS assumption is calculated. For model specification, take a look at Cooper et al. (2007).
A data frame with J1*(M+6), which has optimal M input factors, minimized cost when overally efficient, minimized cost when technically-efficient, revealed cost, overall efficiency, allocative efficiency, and technical efficiency.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
dat.io <- data.frame(y = c(1, 1, 1, 1, 1, 1, 1), x1 = c(2, 3, 5, 9, 6, 3, 8), x2 = c(8, 6, 3, 2, 7, 9, 4)) dat.wm<- c(w1 = 1, w2 = 2) ## market prices of input factors (re <- cost.dea(base = dat.io, noutput = 1, input.price = dat.wm))
dat.io <- data.frame(y = c(1, 1, 1, 1, 1, 1, 1), x1 = c(2, 3, 5, 9, 6, 3, 8), x2 = c(8, 6, 3, 2, 7, 9, 4)) dat.wm<- c(w1 = 1, w2 = 2) ## market prices of input factors (re <- cost.dea(base = dat.io, noutput = 1, input.price = dat.wm))
Solve the Additive Model under the VRS assumption
ddf(base = NULL, frontier = NULL, noutput = 1, direction = NULL)
ddf(base = NULL, frontier = NULL, noutput = 1, direction = NULL)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
direction |
A directional vector for inputs and outputs. |
The DDF under the VRS assumption is calculated. For model specification, take a look at Cooper et al. (2007).
A data frame with J1*(J1+M+N), of which has efficiency scores, optimal weightes and optimal slacks. Take a look at the example below.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
## Simple Example of one input and one output. my.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- ddf(my.dat, noutput = 1, direction = c(1, 1)))
## Simple Example of one input and one output. my.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- ddf(my.dat, noutput = 1, direction = c(1, 1)))
Solve input(output)-oriented DEA under the CRS (VRS)
dea(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1, onlytheta = FALSE)
dea(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1, onlytheta = FALSE)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. |
rts |
Returns to scale. 1 for the CRS assumption, and 2 for the VRS assumption. |
onlytheta |
Logical. If onlytheta is TRUE, then only efficiency scores are obtained. If it is FALSE, then optimal lambda's and slacks are also obtained. |
The input (output) -oriented DEA under the CRS (VRS) assumption are calcuated. For model specification, take a look at Cooper et al. (2007).
If onlytheta is TRUE, then a (J1*1) data.frame is obtained. If onlytheta if FALSE, then a data frame with a J1*(J1+M+N) dimension is obtained, in which optimal weights, input slacks and output slacks are presented.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean)
## input-oriented DEA under the CRS assumption (1 input and 1 output) tab3.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- dea(base = tab3.1.dat, noutput = 1, orientation = 1, rts = 1, onlytheta = FALSE)) ## input-oriented DEA under the CRS assumption (2 inputs and 1 output) tab3.3.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(1, 3, 6, 2, 5, 9), x2 = c(4, 1, 1, 8, 5, 2)) re <- dea(base=tab3.3.dat, noutput = 1, orientation = 1, rts = 1) ## finding references points (ref <- data.frame(y = c(tab3.3.dat$y + re$slack.y1), x1 = c(tab3.3.dat$x1 * re$eff - re$slack.x1), x2 = c(tab3.3.dat$x2 * re$eff - re$slack.x2))) ## output-oriented DEA under the CRS assumption (1 input and 2 outputs) tab5.1.dat <- data.frame(y1 = c(4, 8, 8, 4, 3, 1), y2 = c(9, 6, 4, 3, 5, 6), x = c(1, 1, 1, 1, 1, 1)) (re <- dea(tab5.1.dat, noutput = 2, orientation = 2, rts = 1)) ## input-oriented DEA under the VRS assumption (1 input and 1 output) tab6.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- dea(tab6.1.dat, noutput = 1, orientation = 1, rts = 2)) ## output-oriented DEA under the VRS assumtion (1 input and 1 output) (re <- dea(tab6.1.dat, noutput = 1, orientation = 2, rts = 2)) ## scale efficiency re.crs <- dea(tab6.1.dat, noutput = 1, orientation = 1, rts = 1,onlytheta = TRUE) re.vrs<- dea(tab6.1.dat, noutput = 1, orientation = 1, rts = 2, onlytheta = TRUE) scale.eff <- re.crs/re.vrs ## finding DRS, IRS, CRS dat6.1 <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) re <- dea(dat6.1, noutput = 1, rts = 1) lambdas <- re[, 2:8] apply(lambdas, 1, sum)
## input-oriented DEA under the CRS assumption (1 input and 1 output) tab3.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- dea(base = tab3.1.dat, noutput = 1, orientation = 1, rts = 1, onlytheta = FALSE)) ## input-oriented DEA under the CRS assumption (2 inputs and 1 output) tab3.3.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(1, 3, 6, 2, 5, 9), x2 = c(4, 1, 1, 8, 5, 2)) re <- dea(base=tab3.3.dat, noutput = 1, orientation = 1, rts = 1) ## finding references points (ref <- data.frame(y = c(tab3.3.dat$y + re$slack.y1), x1 = c(tab3.3.dat$x1 * re$eff - re$slack.x1), x2 = c(tab3.3.dat$x2 * re$eff - re$slack.x2))) ## output-oriented DEA under the CRS assumption (1 input and 2 outputs) tab5.1.dat <- data.frame(y1 = c(4, 8, 8, 4, 3, 1), y2 = c(9, 6, 4, 3, 5, 6), x = c(1, 1, 1, 1, 1, 1)) (re <- dea(tab5.1.dat, noutput = 2, orientation = 2, rts = 1)) ## input-oriented DEA under the VRS assumption (1 input and 1 output) tab6.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- dea(tab6.1.dat, noutput = 1, orientation = 1, rts = 2)) ## output-oriented DEA under the VRS assumtion (1 input and 1 output) (re <- dea(tab6.1.dat, noutput = 1, orientation = 2, rts = 2)) ## scale efficiency re.crs <- dea(tab6.1.dat, noutput = 1, orientation = 1, rts = 1,onlytheta = TRUE) re.vrs<- dea(tab6.1.dat, noutput = 1, orientation = 1, rts = 2, onlytheta = TRUE) scale.eff <- re.crs/re.vrs ## finding DRS, IRS, CRS dat6.1 <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) re <- dea(dat6.1, noutput = 1, rts = 1) lambdas <- re[, 2:8] apply(lambdas, 1, sum)
Solve the DDF with undesirable outputs. The directional vecor is (y's, b's).
direc.dea(base = NULL, frontier = NULL, ngood = 1, nbad = 1)
direc.dea(base = NULL, frontier = NULL, ngood = 1, nbad = 1)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+P+Q) dimention, where J1 is the number of DMUs, M for the number of inputs, P for the number of good outputs, and Q for the undesirable outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+P+Q) dimention, where J2 is the number of DMUs, M for the number of inputs, P for the number of good outputs, and Q for the undesirable outputs |
ngood |
The number of good outputs (P). |
nbad |
The number of bad outputs (Q). |
The DDF with undesirable outputs under the CRS assumption is calculated. For model specification, take a look at Chung et al. (1997).
A J1 vector of which is inefficiency score.
Dong-hyun Oh, [email protected]
Chung, Y. Fare, R. and Grosskopf, S. (1997). Productivity and undesirable outputs: A directional distance function approach. Journal of Environmental Management 51(3):229-240.
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
## Simple Example of one input, one good output, and one bad output. my.dat <- data.frame(yg = c(2, 5, 7, 8, 3, 4, 6), yb = c(1, 2, 4, 7, 4, 5, 6), x = c(1, 1, 1, 1, 1, 1, 1)) direc.dea(my.dat, ngood = 1, nbad = 1)
## Simple Example of one input, one good output, and one bad output. my.dat <- data.frame(yg = c(2, 5, 7, 8, 3, 4, 6), yb = c(1, 2, 4, 7, 4, 5, 6), x = c(1, 1, 1, 1, 1, 1, 1)) direc.dea(my.dat, ngood = 1, nbad = 1)
Solve the Dual DEA
dual.dea(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1)
dual.dea(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. |
rts |
Returns to scale. 1 for the CRS assumption, and 2 for the VRS assumption. |
The input-oriented dual DEA under the CRS assumption is calculated. For model specification, take a look at Cooper et al. (2007).
A data frame with J1*(1+M+N) dimension, of which has efficiency scores, optimal virtual prices for inputs and outputs.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
## An output-oriented primal problem with 1 input and 2 outputs tab5.1.dat <- data.frame(y1 = c(4, 8, 8, 4, 3, 1), y2 = c(9, 6, 4, 3, 5, 6), x = c(1, 1, 1, 1, 1, 1)) (re <- dea(tab5.1.dat, noutput = 2, orientation = 2, rts = 1)) ## An output-oriented dual problem with 1 input and 2 outputs re <- dual.dea(tab5.1.dat, noutput = 2, orientation = 2, rts = 1)
## An output-oriented primal problem with 1 input and 2 outputs tab5.1.dat <- data.frame(y1 = c(4, 8, 8, 4, 3, 1), y2 = c(9, 6, 4, 3, 5, 6), x = c(1, 1, 1, 1, 1, 1)) (re <- dea(tab5.1.dat, noutput = 2, orientation = 2, rts = 1)) ## An output-oriented dual problem with 1 input and 2 outputs re <- dual.dea(tab5.1.dat, noutput = 2, orientation = 2, rts = 1)
Solve input(output)-oriented DEA under the CRS (VRS) with convexhull. Do not use when the total number of inputs and outputs are greater than eight. If used, it may take more than hundreds day to get results.
effdea.b.f(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1, convhull = TRUE)
effdea.b.f(base = NULL, frontier = NULL, noutput = 1, orientation=1, rts = 1, convhull = TRUE)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. |
rts |
Returns to scale. 1 for the CRS assumption, and 2 for the VRS assumption. |
convhull |
Logical. If this is TRUE, very efficient calculation of efficiency score is used. However, when the total number of inputs and outputs is larger than eight, it is very slow for this option. In cases when the total number of inputs and outputs is larger than eight, use FALSE for this argument. |
This function uses the convhull function in geometry package. After finding convex hull of frontier by using the convhull function. points on the convex hull are used in constructing the second production possibility set (PPS). Then efficiency scores in base are calculated based on the second PPS.
A data frame with J1*1 dimension, which shows efficiency scores.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean)
## input-oriented DEA under the CRS assumption (1 input and 1 output) tab3.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- effdea.b.f(base = tab3.1.dat, noutput = 1, orientation = 1, rts = 1, convhull = TRUE))
## input-oriented DEA under the CRS assumption (1 input and 1 output) tab3.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- effdea.b.f(base = tab3.1.dat, noutput = 1, orientation = 1, rts = 1, convhull = TRUE))
Calculate productivity growth index under the DEA framework.
faremalm2(dat = NULL, noutput = 1, id = "id", year = "year")
faremalm2(dat = NULL, noutput = 1, id = "id", year = "year")
dat |
A data frame to be evaluated. The format of this data frame is data.frame(id, year, outputs, inputs). This data frame should have a balanced panel data form. |
noutput |
The number of outputs. |
id |
A column name for the producer index. |
year |
A column name for the time index. |
The Malmquist productivity growth index is calculated. For model specification, take a look at Fare et al. (1994).
A data frame with (
id: the id index of the original data.
time: the time index of the original data.
y's: original outputs
x's: original inputs
Dt2t2:
Dtt2:
Dt2t:
ec: efficiency change
tc: technical change
pc: productivity change
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Fare, R., Grosskopf, S., Norris, M. and Zhang, Z. (1994). Productivity growth, technical progress and efficiency change in industrialized countries. American Economic Review, 84(1):66-83.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
malm.dat <- data.frame(id = rep(LETTERS[1:3], 3), time = rep(1:3, each = 3), y = c(1, 2, 2, 3, 2, 8, 3, 2, 5), x = c(2, 3, 7, 3, 5, 6, 8, 9, 6)) malm.re1 <- faremalm2(malm.dat, noutput = 1, id = "id", year = "time") ## Malmquist productivity growth index of OECD countries library(pwt) ## Use Penn World Table library(psych) my.dat <- pwt5.6 head(my.dat) my.oecd.ctry <- c("AUS", "AUT", "BEL", "CAN", "CHE", "DNK", "ESP", "FIN", "FRA", "GBR", "GER", "GRC", "IRL", "ISL", "ITA", "JPN", "KOR", "LUX", "MEX", "NLD", "NOR", "NZL", "PRT", "SWE", "TUR", "USA", "DEU") my.dat <- my.dat[my.dat$wbcode %in% my.oecd.ctry,] my.dat <- my.dat[my.dat$year %in% 1980:1990,] my.dat$rgdpl <- as.numeric(my.dat$rgdpl) ## GDP per capita my.dat$pop <- as.numeric(my.dat$pop) ## total population (1000) my.dat$rgdpwok <- as.numeric(my.dat$rgdpwok) ## GDP per labor my.dat$kapw <- as.numeric(my.dat$kapw) ## Capital stock per labor my.dat$gdp <- my.dat$rgdpl * my.dat$pop ## Total GDP of a country my.dat$labor <- with(my.dat, gdp/rgdpwok) ## Total labor force my.dat$capital <- with(my.dat, kapw * labor) ## Toal capital stock oecd <- my.dat[, c("wbcode", "year", "gdp", "labor", "capital")] re.oecd <- faremalm2(dat = oecd, noutput = 1, id = "wbcode", year = "year") ## productivity growth for each country pc.c <- tapply(re.oecd$pc, re.oecd$wbcode, geometric.mean) ## a trend of productivity growth of OECD countries pc.y <- tapply(re.oecd$pc, re.oecd$year, geometric.mean) ## efficiency change for each country ec.c <- tapply(re.oecd$ec, re.oecd$wbcode, geometric.mean) ## a trend of efficiency change of OECD countries ec.y <- tapply(re.oecd$ec, re.oecd$year, geometric.mean)
malm.dat <- data.frame(id = rep(LETTERS[1:3], 3), time = rep(1:3, each = 3), y = c(1, 2, 2, 3, 2, 8, 3, 2, 5), x = c(2, 3, 7, 3, 5, 6, 8, 9, 6)) malm.re1 <- faremalm2(malm.dat, noutput = 1, id = "id", year = "time") ## Malmquist productivity growth index of OECD countries library(pwt) ## Use Penn World Table library(psych) my.dat <- pwt5.6 head(my.dat) my.oecd.ctry <- c("AUS", "AUT", "BEL", "CAN", "CHE", "DNK", "ESP", "FIN", "FRA", "GBR", "GER", "GRC", "IRL", "ISL", "ITA", "JPN", "KOR", "LUX", "MEX", "NLD", "NOR", "NZL", "PRT", "SWE", "TUR", "USA", "DEU") my.dat <- my.dat[my.dat$wbcode %in% my.oecd.ctry,] my.dat <- my.dat[my.dat$year %in% 1980:1990,] my.dat$rgdpl <- as.numeric(my.dat$rgdpl) ## GDP per capita my.dat$pop <- as.numeric(my.dat$pop) ## total population (1000) my.dat$rgdpwok <- as.numeric(my.dat$rgdpwok) ## GDP per labor my.dat$kapw <- as.numeric(my.dat$kapw) ## Capital stock per labor my.dat$gdp <- my.dat$rgdpl * my.dat$pop ## Total GDP of a country my.dat$labor <- with(my.dat, gdp/rgdpwok) ## Total labor force my.dat$capital <- with(my.dat, kapw * labor) ## Toal capital stock oecd <- my.dat[, c("wbcode", "year", "gdp", "labor", "capital")] re.oecd <- faremalm2(dat = oecd, noutput = 1, id = "wbcode", year = "year") ## productivity growth for each country pc.c <- tapply(re.oecd$pc, re.oecd$wbcode, geometric.mean) ## a trend of productivity growth of OECD countries pc.y <- tapply(re.oecd$pc, re.oecd$year, geometric.mean) ## efficiency change for each country ec.c <- tapply(re.oecd$ec, re.oecd$wbcode, geometric.mean) ## a trend of efficiency change of OECD countries ec.y <- tapply(re.oecd$ec, re.oecd$year, geometric.mean)
Solve input(output)-oriented FDH
fdh(base = NULL, frontier = NULL, noutput = 1, orientation=1)
fdh(base = NULL, frontier = NULL, noutput = 1, orientation=1)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. |
The input (output) -oriented FDH is calculated.
A data frame of J1*1 dimention which shows efficiency scores.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
## input-oriented FDH with 1 input and 1 output. tab7.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- fdh(tab7.1.dat, noutput = 1, orientation = 1)) ## input-oriented FDH with 2 input and 1 output. tab7.10.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(2, 3, 6, 3, 6, 6), x2 = c(5, 3, 1, 8, 4, 2)) (re <- fdh(tab7.10.dat, noutput = 1, orientation = 1))
## input-oriented FDH with 1 input and 1 output. tab7.1.dat <- data.frame(y = c(1, 2, 4, 6, 7, 9, 9), x = c(3, 2, 6, 4, 8, 8, 10)) (re <- fdh(tab7.1.dat, noutput = 1, orientation = 1)) ## input-oriented FDH with 2 input and 1 output. tab7.10.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(2, 3, 6, 3, 6, 6), x2 = c(5, 3, 1, 8, 4, 2)) (re <- fdh(tab7.10.dat, noutput = 1, orientation = 1))
Solve input-oriented DEA under the CRS
int.dea(base = NULL, frontier = NULL, noutput = 1, intinput = 1, orientation=1, epsilon = 1e-06)
int.dea(base = NULL, frontier = NULL, noutput = 1, intinput = 1, orientation=1, epsilon = 1e-06)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
intinput |
The number of integer inputs. |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. This argument is ignored. |
epsilon |
Non-Armechidean number. Use the default value. |
The input-oriented IDEA under the CRS assumption is calcualted. See Kuosmanen and Matin (2009).
A data frame of J1*(1+J1+N+M+Q+Q), which shows efficiency scores, optimal weightes, optimal slacks for outputs and inputs, optiaml slacks for integer-valued inputs, and optimal integer inputs.
Dong-hyun Oh, [email protected]
Kuomanen, T. and Matin, R. (2009). Theory of integer-valued data envelopment analysis. European Journal of Operational Research 192(2):658-667
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
int.dat <- data.frame(y = c(1, 1, 1, 1, 1), x1 = c(2, 7, 3, 7, 9), x2 = c(4, 1, 4, 2, 4)) int.dea(int.dat, noutput = 1, intinput = 1)
int.dat <- data.frame(y = c(1, 1, 1, 1, 1), x1 = c(2, 7, 3, 7, 9), x2 = c(4, 1, 4, 2, 4)) int.dea(int.dat, noutput = 1, intinput = 1)
Solve LP with free variables
lp2(direction = "min", objective.in, const.mat, const.dir, const.rhs, free.var = NULL)
lp2(direction = "min", objective.in, const.mat, const.dir, const.rhs, free.var = NULL)
direction |
Character string giving direction of optimization: "min" (default) or "max." |
objective.in |
Numeric vector of coefficients of objective function |
const.mat |
Matrix of numeric constraint coefficients, one row per constraint, one column per variable (unless transpose.constraints = FALSE; see below). |
const.dir |
Vector of character strings giving the direction of the constraint: each value should be one of "<," "<=," "=," "==," ">," or ">=". (In each pair the two values are identical.) |
const.rhs |
Vector of numeric values for the right-hand sides of the constraints. |
free.var |
Vector of numeric values for indicating free variables. If this argument is NULL, no free variables is included. |
lp2 extends lpSolve::lp() to incorporate free variables easily.
An lp object. See 'lp.object' for details.
Dong-hyun Oh, [email protected]
# Set up problem: maximize # x1 + 9 x2 + x3 subject to # x1 + 2 x2 + 3 x3 <= 9 # 3 x1 + 2 x2 + 2 x3 <= 15 # f.obj <- c(1, 9, 3) f.con <- matrix (c(1, 2, 3, 3, 2, 2), nrow=2, byrow=TRUE) f.dir <- c("<=", "<=") f.rhs <- c(9, 15) # # Now run. # lp2("max", f.obj, f.con, f.dir, f.rhs) lp2("max", f.obj, f.con, f.dir, f.rhs, free.var = c(0, 1, 0))
# Set up problem: maximize # x1 + 9 x2 + x3 subject to # x1 + 2 x2 + 3 x3 <= 9 # 3 x1 + 2 x2 + 2 x3 <= 15 # f.obj <- c(1, 9, 3) f.con <- matrix (c(1, 2, 3, 3, 2, 2), nrow=2, byrow=TRUE) f.dir <- c("<=", "<=") f.rhs <- c(9, 15) # # Now run. # lp2("max", f.obj, f.con, f.dir, f.rhs) lp2("max", f.obj, f.con, f.dir, f.rhs, free.var = c(0, 1, 0))
Calculate order-m efficiency scores
orderm(base = NULL, frontier = NULL, noutput = 1, orientation=1, M = 25, B = 500)
orderm(base = NULL, frontier = NULL, noutput = 1, orientation=1, M = 25, B = 500)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
orientation |
Orientation of measurement. 1 for the input-oriented measure, and 2 for the output-oriented measure. |
M |
The number of elements in each of the bootstrapped samples. |
B |
The number of bootstap replicates |
See Simar (2003).
A data frame with J1*1 dimention, which shows efficiency scores.
Dong-hyun Oh, [email protected]
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
Simar, L. (2003). Detecting outliers in frontier models: A simple approach. Journal of Productivity Analysis, 20(3):391-424.
x <- abs(runif(200, min = 0.1, max = 4)) y <- 3*x*abs(rnorm(200)) dat.orderm <- data.frame(y = y, x = x) dat.orderm.out <- rbind(dat.orderm, c(4, 0.1)) ## add one outlier. (eff <- orderm(dat.orderm.out, noutput = 1, M = 25, B = 20))
x <- abs(runif(200, min = 0.1, max = 4)) y <- 3*x*abs(rnorm(200)) dat.orderm <- data.frame(y = y, x = x) dat.orderm.out <- rbind(dat.orderm, c(4, 0.1)) ## add one outlier. (eff <- orderm(dat.orderm.out, noutput = 1, M = 25, B = 20))
Solve the Revenue Maximization Probem with Given Output Prices
revenue.dea(base = NULL, frontier = NULL, noutput = 1, output.price = NULL)
revenue.dea(base = NULL, frontier = NULL, noutput = 1, output.price = NULL)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to be used in constructing a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (M). |
output.price |
A vector for market prices of outputs. |
The revenue maximization problem under the CRS assumption is calculated. See Cooper et al. (2007).
A data frame with J1*(N+6), which has optimal N output factors, maximized revenue when overally efficient, maximized revenue when technically-efficient, revealed revenue, overall efficiency, allocative efficiency, and technical efficiency.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
tab8.3 <- data.frame(y1 = c(1, 3, 6, 6, 3, 9), y2 = c(6, 6, 3, 5, 4, 1), x = c(1, 1, 1, 1, 1, 1)) tab8.3.ps.f <- c(p1 = 2, p2 = 2) (ex8.3 <- revenue.dea(base = tab8.3, noutput = 2, output.price = tab8.3.ps.f))
tab8.3 <- data.frame(y1 = c(1, 3, 6, 6, 3, 9), y2 = c(6, 6, 3, 5, 4, 1), x = c(1, 1, 1, 1, 1, 1)) tab8.3.ps.f <- c(p1 = 2, p2 = 2) (ex8.3 <- revenue.dea(base = tab8.3, noutput = 2, output.price = tab8.3.ps.f))
Solve Slacks-based Model under the CRS (Tone, 2001)
sbm.tone(base= NULL, frontier = NULL, noutput = 1)
sbm.tone(base= NULL, frontier = NULL, noutput = 1)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to construct a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
The SBM under the CRS assumption is calculated. See Tone (2001).
A data frame with (1+J1+M+N), which shows efficiency scores, optimal weights, and optiaml input and output slacks.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
Tone, K. (2001). A slacks-based measure of efficiency in data envelopment analysis. European Journal of Operational Research, 130(3):498-509.
tab7.6.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(1, 3, 6, 2, 5, 9), x2 = c(4, 1, 1, 8, 5, 2)) (re <- sbm.tone(tab7.6.dat, noutput = 1))
tab7.6.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(1, 3, 6, 2, 5, 9), x2 = c(4, 1, 1, 8, 5, 2)) (re <- sbm.tone(tab7.6.dat, noutput = 1))
Solve Slacks-based Model under the VRS (Tone, 2001)
sbm.vrs(base= NULL, frontier = NULL, noutput = 1)
sbm.vrs(base= NULL, frontier = NULL, noutput = 1)
base |
A data set for DMUs to be evaluated. A data frame with J1*(M+N) dimention, where J1 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
frontier |
A data set for DMUs to construct a production possibility set (PPS). A data frame with J2*(M+N) dimention, where J2 is the number of DMUs, M for the number of inputs, and N for the number of outputs. |
noutput |
The number of outputs (N). |
The SBM under the VRS assumption is calculated. See Tone (2001).
A data frame with (1+J1+M+N), which shows efficiency scores, optimal weights, and optiaml input and output slacks.
Dong-hyun Oh, [email protected]
Cooper, W., Seiford, L. and Tone, K. (2007). Data envelopment analysis: a comprehensive text with models, applications, references and DEA-solver software (2nd ed.). Springer Verlag, New York.
Lee, J. and Oh, D. (forthcoming). Efficiency Analysis: Data Envelopment Analysis. Press (in Korean).
Tone, K. (2001). A slacks-based measure of efficiency in data envelopment analysis. European Journal of Operational Research, 130(3):498-509.
tab7.6.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(1, 3, 6, 2, 5, 9), x2 = c(4, 1, 1, 8, 5, 2)) (re <- sbm.vrs(tab7.6.dat, noutput = 1))
tab7.6.dat <- data.frame(y = c(1, 1, 1, 1, 1, 1), x1 = c(1, 3, 6, 2, 5, 9), x2 = c(4, 1, 1, 8, 5, 2)) (re <- sbm.vrs(tab7.6.dat, noutput = 1))