The DEA (Data Envelopment Analysis) is popular in estimating the efficiency. Despite its appealing non-parametric features, the DEA has certain shortages. In my case, I have never been convinced that there are production units operating at frontier, which has efficiency value to be 1. The real world is in chaos (or “messed up”). Anyhow, the DEA is an analysis based upon comparison. Maybe, it is time to pick up the parametric estimation method. Yes, the parametric method has the risk of misspecification. Well, do not tell me you have never run a single regression. And, there is no reason to examplify the risk in estimating the production efficiency. Here is a short script which deals with the SFA. There is a package “frontier” available in CRAN. But, I prefer the home-made codes. And, I have confirmed that it would return (nearly) identical results. (Actually, I used the sample dataset in it.)

data(front41Data)

LL <- function(beta0, beta1, beta2, lambda, sigma) {
  res <- log(output) - beta0 - beta1 * log(capital) - beta2 * log(labour)
  score <- -log(sigma) + (1/2)*log(2/pi) -(1/2)*(res/sigma)^2+ log(pnorm(-res*lambda/sigma,0,1))
  -sum(score)
}

fit <- mle2(LL, start = list(beta0 = 1, beta1 = 1, beta2 = 1, lambda = 3, sigma = 1), data = front41Data, 
            method = "L-BFGS-B", trace = TRUE, lower = c(beta0 = -Inf, beta1 = -Inf, beta2 = -Inf, lambda = 0, sigma = 0), 
            upper = c(beta0 = Inf, beta1 = Inf, beta2 = Inf,lambda = Inf, sigma = 10))

summary(fit) # return the estimates.
## Maximum likelihood estimation
## 
## Call:
## mle2(minuslogl = LL, start = list(beta0 = 1, beta1 = 1, beta2 = 1, 
##     lambda = 3, sigma = 1), method = "L-BFGS-B", data = front41Data, 
##     trace = TRUE, lower = c(beta0 = -Inf, beta1 = -Inf, beta2 = -Inf, 
##         lambda = 0, sigma = 0), upper = c(beta0 = Inf, beta1 = Inf, 
##         beta2 = Inf, lambda = Inf, sigma = 10))
## 
## Coefficients:
##        Estimate Std. Error z value     Pr(z)    
## beta0  0.561495   0.202571  2.7718  0.005574 ** 
## beta1  0.281116   0.047496  5.9187 3.245e-09 ***
## beta2  0.536505   0.045171 11.8772 < 2.2e-16 ***
## lambda 1.982720   0.849416  2.3342  0.019584 *  
## sigma  0.465827   0.069127  6.7387 1.598e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## -2 log L: 34.05445
# check with the package. 
cobbDouglas <- sfa( log(output) ~ log(capital) + log(labour),
                    data = front41Data )
summary(cobbDouglas)
## Error Components Frontier (see Battese & Coelli 1992)
## Inefficiency decreases the endogenous variable (as in a production function)
## The dependent variable is logged
## Iterative ML estimation terminated after 7 iterations:
## log likelihood values and parameters of two successive iterations
## are within the tolerance limit
## 
## final maximum likelihood estimates
##              Estimate Std. Error z value  Pr(>|z|)    
## (Intercept)  0.561619   0.202617  2.7718 0.0055742 ** 
## log(capital) 0.281102   0.047643  5.9001 3.632e-09 ***
## log(labour)  0.536480   0.045252 11.8555 < 2.2e-16 ***
## sigmaSq      0.217000   0.063909  3.3955 0.0006851 ***
## gamma        0.797207   0.136424  5.8436 5.109e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## log likelihood value: -17.02722 
## 
## cross-sectional data
## total number of observations = 60 
## 
## mean efficiency: 0.7405678
# Note that the "gamma" returned is not the "lambda" we obtained. See below. 
coef(cobbDouglas, which = "mle", extraPar = T)
##  (Intercept) log(capital)  log(labour)      sigmaSq        gamma 
##   0.56161929   0.28110219   0.53647979   0.21700029   0.79720690 
##     sigmaSqU     sigmaSqV        sigma       sigmaU       sigmaV 
##   0.17299413   0.04400616   0.46583290   0.41592563   0.20977646 
##     lambdaSq       lambda         varU          sdU     gammaVar 
##   3.93113424   1.98270881   0.06286265   0.25072424   0.58822258

With all the codes, you are basically able to handle any extended jobs associated with SFA analysis, such as efficiency values calculation.