| Title: | Stochastic Metafrontier Analysis |
|---|---|
| Description: | Implements stochastic metafrontier analysis for productivity and performance benchmarking across firms operating under different technologies. Contains routines for the deterministic metafrontier envelope of O'Donnell et al. (2008) <doi:10.1007/s00181-007-0119-4> via linear and quadratic programming, and the stochastic metafrontier of Huang et al. (2014) <doi:10.1007/s11123-014-0402-2>. Also supports latent class stochastic metafrontier analysis and sample selection correction stochastic metafrontier models. Depends on the 'sfaR' package by Dakpo et al. (2023) <https://CRAN.R-project.org/package=sfaR>. |
| Authors: | Sulman Olieko Owili [aut, cre] (ORCID: <https://orcid.org/0000-0001-7401-5326>) |
| Maintainer: | Sulman Olieko Owili <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-06-05 06:14:02 UTC |
| Source: | https://github.com/sulmanolieko/smfa |
From an object of class 'summary.smfa',
coef extracts the coefficients,
their standard errors, z-values, and (asymptotic) P-values.
From on object of class 'smfa', it extracts
only the estimated coefficients.
## S3 method for class 'smfa' coef(object, ...) ## S3 method for class 'summary.smfa' coef(object, ...)## S3 method for class 'smfa' coef(object, ...) ## S3 method for class 'summary.smfa' coef(object, ...)
object |
A stochastic metafrontier model returned by |
... |
Currently ignored. |
For objects of class 'summary.smfa',
coef returns a matrix with four columns. Namely, the
estimated coefficients, their standard errors, z-values,
and (asymptotic) P-values.
For objects of class 'smfa', coef
returns a numeric vector of the estimated coefficients.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data.
efficiencies returns all efficiency estimates and metatechnology ratio
(MTR) measures for objects of class "smfa" returned by
smfa. The function supports models estimated via
linear programming (LP), quadratic programming (QP), and stochastic
second-stage SFA ("sfa"), and for each observation it computes the
group-specific technical efficiency, the metafrontier technical efficiency,
and the metatechnology ratio (MTR), using both the Jondrow, Lovell, Materov,
and Schmidt (1982) (JLMS) and the Battese and Coelli (1988) (BC) estimators.
Additional model-specific columns are returned depending on groupType.
## S3 method for class 'smfa' efficiencies(object, level = 0.95, newData = NULL, ...)## S3 method for class 'smfa' efficiencies(object, level = 0.95, newData = NULL, ...)
object |
An object of class |
level |
A number strictly between 0 and 0.9999 specifying the nominal
coverage for (in-)efficiency confidence intervals. Default |
newData |
Optional data frame for out-of-sample prediction of efficiency
estimates. When |
... |
Further arguments (currently ignored). |
For each group, the group-level frontier model is estimated by maximising
the log-likelihood using the distribution specified by udist in
smfa. Given the estimated composite error
, the conditional distribution of
is used to compute:
the JLMS estimator (Jondrow, Lovell, Materov, and Schmidt, 1982):
, and
;
the BC estimator (Battese and Coelli, 1988):
;
the mode estimator: ,
and ;
confidence bounds on and at the
nominal level level.
For groupType = "sfaselectioncross", all estimates are NA
for observations not selected into the sample (binary selection indicator
equal to 0). For groupType = "sfalcmcross", the composite
efficiencies u_g, TE_group_JLMS, and TE_group_BC
are computed using the posterior-probability-weighted class assignments.
The MTR measures how far the group frontier lies below the metafrontier
for each observation. Let be the group-specific
fitted frontier value and the metafrontier fitted
value.
For metaMethod = "lp" or "qp" (Battese, Rao, and
O'Donnell, 2004):
where for production/profit frontiers and
for cost frontiers. The technology gap
is stored in u_meta.
For metaMethod = "sfa" with sfaApproach = "huang"
(Huang, Huang, and Liu, 2014):
where is the one-sided error term from the second-stage SFA.
For metaMethod = "sfa" with
sfaApproach = "ordonnell" (O'Donnell, Rao, and Battese, 2008):
, where
is the technical efficiency from the
second-stage SFA fitted on the LP envelope values.
The metafrontier technical efficiency is then:
computed separately for the JLMS and BC group efficiency estimators.
Both MTR_JLMS and MTR_BC are reported, distinguishing
which group-level efficiency estimator was used as the basis.
A data frame with one row per observation (in the original row order),
containing the following columns. The exact set of columns depends on
groupType:
Columns present for all model types:
idObservation identifier. Contains the row name of each observation as
it appeared in the data supplied to smfa.
When the data frame has no explicit row names, sequential integers
("1", "2", ...) are used. This column is always the
first column of the returned data frame.
<group> or Group_c
The technology group identifier for each observation. For
groupType = "sfacross" and "sfaselectioncross", this
column takes the name of the user-supplied group variable and
contains the group label to which each observation belongs. For
groupType = "sfalcmcross", it is named Group_c and
contains the integer index of the latent class assigned by the maximum
posterior probability criterion.
u_gGroup-specific conditional mean of the inefficiency term, computed as
. This is the JLMS (Jondrow, Lovell,
Materov, and Schmidt, 1982) point estimate of the inefficiency at the
group-frontier level. For groupType = "sfaselectioncross",
u_g is NA for observations not selected into the sample
(selection indicator = 0).
TE_group_JLMSGroup-specific technical efficiency using the Jondrow, Lovell,
Materov, and Schmidt (1982) estimator:
. For
groupType = "sfaselectioncross", NA for non-selected
observations.
TE_group_BCGroup-specific technical efficiency using the Battese and Coelli
(1988) estimator:
. For
groupType = "sfaselectioncross", NA for non-selected
observations.
TE_group_BC_reciprocalReciprocal of the Battese and Coelli (1988) group technical efficiency:
. For production frontiers this equals the
cost-efficiency index implied by the BC estimator. Present for all three
model types. For groupType = "sfaselectioncross", NA for
non-selected observations.
u_metaMetafrontier inefficiency, measuring the technology-gap component
that separates the group frontier from the global
metafrontier. Computed from the second-stage SFA when
metaMethod = "sfa", or derived from the LP/QP gap as
when metaMethod = "lp" or "qp".
TE_meta_JLMSMetafrontier technical efficiency based on the JLMS group efficiency:
.
TE_meta_BCMetafrontier technical efficiency based on the Battese and Coelli
(1988) group efficiency:
.
MTR_JLMSMetatechnology ratio computed using the JLMS group efficiency:
.
Values range from 0 to 1. A value of 1 indicates that the group
frontier for this observation coincides with the metafrontier.
MTR_BCMetatechnology ratio computed using the Battese and Coelli (1988)
group efficiency:
.
Additional columns for groupType = "sfacross" only:
uLB_g, uUB_g
Lower and upper bounds of the level confidence interval for the
conditional mean inefficiency u_g, constructed using the
asymptotic distribution of the conditional estimator. Available for
distributions with closed-form expressions for the confidence bounds,
such as udist = "hnormal" and udist = "tnormal".
m_gMode of the conditional distribution of the one-sided error term
. This is an alternative point estimate of
inefficiency. Available for distributions for which the conditional mode
has a closed-form expression.
TE_group_modeGroup-specific technical efficiency evaluated at the conditional mode:
.
teBCLB_g, teBCUB_g
Lower and upper bounds of the level confidence interval for the
Battese and Coelli (1988) group technical efficiency TE_group_BC.
Constructed from the corresponding bounds on the conditional
distribution of .
Additional columns for groupType = "sfalcmcross" only:
PosteriorProb_cPosterior probability that observation belongs to its assigned
class (the one with the highest posterior probability). Computed via
Bayes' rule as
,
where is the prior class probability and
is the class-conditional likelihood.
PosteriorProb_cJ (per class, )Posterior probability of belonging to latent class , computed
via Bayes' rule for each class separately. One column is produced for
each estimated class.
PriorProb_cJ (per class, )Prior (unconditional) probability of belonging to latent class ,
given by the logistic specification
.
u_cJ (per class, )Conditional mean of the inefficiency term for class :
.
teBC_cJ (per class, )Battese and Coelli (1988) technical efficiency for class :
.
teBC_reciprocal_cJ (per class, )Reciprocal of the class- Battese and Coelli (1988) efficiency:
.
ineff_cJ (per class, )Inefficiency estimate for the observation restricted to class
(i.e. the value assigned to the class to which the observation
does belong; NA for other classes).
effBC_cJ (per class, )Battese and Coelli (1988) efficiency for the observation's assigned
class; NA for non-assigned classes.
ReffBC_cJ (per class, )Reciprocal Battese and Coelli (1988) efficiency for the observation's
assigned class; NA for non-assigned classes.
Battese, G. E., and Coelli, T. J. 1988. Prediction of firm-level technical efficiencies with a generalized frontier production function and panel data. Journal of Econometrics, 38(3), 387–399. doi:10.1016/0304-4076(88)90053-X
Battese, G. E., Rao, D. S. P., and O'Donnell, C. J. 2004. A metafrontier production function for estimation of technical efficiencies and technology gaps for firms operating under different technologies. Journal of Productivity Analysis, 21(1), 91–103. doi:10.1023/B:PROD.0000012454.06094.29
Huang, C. J., Huang, T.-H., and Liu, N.-H. 2014. A new approach to estimating the metafrontier production function based on a stochastic frontier framework. Journal of Productivity Analysis, 42(3), 241–254. doi:10.1007/s11123-014-0402-2
Jondrow, J., Lovell, C. A. K., Materov, I. S., and Schmidt, P. 1982. On the estimation of technical inefficiency in the stochastic frontier production function model. Journal of Econometrics, 19(2-3), 233–238. doi:10.1016/0304-4076(82)90004-5
O'Donnell, C. J., Rao, D. S. P., and Battese, G. E. 2008. Metafrontier frameworks for the study of firm-level efficiencies and technology ratios. Empirical Economics, 34(2), 231–255. doi:10.1007/s00181-007-0119-4
Orea, L., and Kumbhakar, S. C. 2004. Efficiency measurement using a latent class stochastic frontier model. Empirical Economics, 29(1), 169–183. doi:10.1007/s00181-003-0184-2
Dakpo, K. H., Desjeux, Y., and Latruffe, L. 2023. sfaR: Stochastic Frontier Analysis using R. R package version 1.0.1. https://CRAN.R-project.org/package=sfaR
smfa, for the stochastic metafrontier
analysis model fitting function using cross-sectional or pooled data;
efficiencies, for the underlying group-level efficiency
extractor.
fitted returns the fitted frontier values from stochastic
metafrontier models estimated with smfa.
## S3 method for class 'smfa' fitted(object, ...)## S3 method for class 'smfa' fitted(object, ...)
object |
A stochastic metafrontier model returned
by |
... |
Currently ignored. |
A vector of fitted values is returned.
The fitted values are ordered in the same way as the corresponding observations in the dataset used for the estimation.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data.
ic returns information criterion from stochastic
metafrontier models estimated with smfa.
## S3 method for class 'smfa' ic(object, IC = NULL, ...)## S3 method for class 'smfa' ic(object, IC = NULL, ...)
object |
A stochastic metafrontier model returned
by |
IC |
Character string. Information criterion measure. Three criteria are available:
. |
... |
Currently ignored. |
The different information criteria are computed as follows:
AIC:
BIC:
HQIC:
where
is the maximum likelihood value, the number of parameters
estimated and the number of observations.
ic returns a data frame with the values of the
information criteria (AIC, BIC and HQIC) of the maximum likelihood coefficients.
If the IC argument is provided, it returns only the requested criterion
as a numeric value.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data.
logLik extracts the log-likelihood value(s) from stochastic
metafrontier models estimated with smfa.
## S3 method for class 'smfa' logLik(object, individual = FALSE, ...)## S3 method for class 'smfa' logLik(object, individual = FALSE, ...)
object |
A stochastic metafrontier model returned
by |
individual |
Logical. If |
... |
Currently ignored. |
logLik returns either an object of class
'logLik', which is the log-likelihood value with the total number of
observations (nobs) and the number of free parameters (df) as
attributes, when individual = FALSE, or a list of elements, containing
the log-likelihood of each observation (logLik), the total number of
observations (Nobs) and the number of free parameters (df),
when individual = TRUE.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data.
This function extracts the total number of 'observations' from a fitted point frontier model.
## S3 method for class 'smfa' nobs(object, ...)## S3 method for class 'smfa' nobs(object, ...)
object |
a |
... |
Currently ignored. |
nobs gives the number of observations actually
used by the estimation procedure.
A single number, normally an integer.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data
This function returns the residuals' values from stochastic metafrontier models
estimated with smfa.
## S3 method for class 'smfa' residuals(object, ...)## S3 method for class 'smfa' residuals(object, ...)
object |
A stochastic metafrontier model returned
by |
... |
Currently ignored. |
residuals returns a vector of residuals values.
The residuals values are ordered in the same way as the corresponding observations in the dataset used for the estimation.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data.
smfa estimates a stochastic metafrontier model
for cross-sectional or pooled data. The function follows the theoretical
frameworks of Battese, Rao, and O'Donnell (2004) and O'Donnell, Rao, and
Battese (2008), and additionally implements the two-stage stochastic approach
of Huang, Huang, and Liu (2014). Three types of group-level frontier models
are supported: standard stochastic frontier analysis
(sfacross), sample selection stochastic frontier
analysis (sfaselectioncross), and latent class stochastic
frontier analysis (sfalcmcross).
smfa( formula, muhet, uhet, vhet, thet, logDepVar = TRUE, data, subset, weights, wscale = TRUE, group = NULL, S = 1L, udist = "hnormal", start = NULL, scaling = FALSE, modelType = "greene10", groupType = "sfacross", metaMethod = "lp", sfaApproach = "ordonnell", selectionF = NULL, lcmClasses = 2L, whichStart = 2L, initAlg = "nm", initIter = 100L, lType = "ghermite", Nsub = 100L, uBound = Inf, intol = 1e-06, method = "bfgs", hessianType = NULL, simType = "halton", Nsim = 100L, prime = 2L, burn = 10L, antithetics = FALSE, seed = 12345L, itermax = 2000L, printInfo = FALSE, tol = 1e-12, gradtol = 1e-06, stepmax = 0.1, qac = "marquardt", ... ) ## S3 method for class 'smfa' print(x, ...)smfa( formula, muhet, uhet, vhet, thet, logDepVar = TRUE, data, subset, weights, wscale = TRUE, group = NULL, S = 1L, udist = "hnormal", start = NULL, scaling = FALSE, modelType = "greene10", groupType = "sfacross", metaMethod = "lp", sfaApproach = "ordonnell", selectionF = NULL, lcmClasses = 2L, whichStart = 2L, initAlg = "nm", initIter = 100L, lType = "ghermite", Nsub = 100L, uBound = Inf, intol = 1e-06, method = "bfgs", hessianType = NULL, simType = "halton", Nsim = 100L, prime = 2L, burn = 10L, antithetics = FALSE, seed = 12345L, itermax = 2000L, printInfo = FALSE, tol = 1e-12, gradtol = 1e-06, stepmax = 0.1, qac = "marquardt", ... ) ## S3 method for class 'smfa' print(x, ...)
formula |
A symbolic description of the frontier model to be estimated,
based on the generic function |
muhet |
A one-part formula to account for heterogeneity in the mean of
the pre-truncated normal distribution. Applicable only when
|
uhet |
A one-part formula to account for heteroscedasticity in the
one-sided error variance. Applicable for all three model types. The
variance of the inefficiency term is modelled as
|
vhet |
A one-part formula to account for heteroscedasticity in the
two-sided error variance. Applicable for all three model types. The
variance of the noise term is modelled as
|
thet |
A one-part formula to account for technological heterogeneity
in the construction of the latent classes. Applicable only when
|
logDepVar |
Logical. Informs whether the dependent variable is logged
( |
data |
A data frame containing all variables referenced in
|
subset |
An optional vector specifying a subset of observations to be used in the estimation process. |
weights |
An optional vector of weights to be used for weighted
log-likelihood estimation. Should be |
wscale |
Logical. When
Default |
group |
Character string. The name of the column in |
S |
Integer. Frontier orientation.
|
udist |
Character string. Distribution for the one-sided error term
For |
start |
Numeric vector. Optional starting values for the maximum
likelihood (ML) or maximum simulated likelihood (MSL) estimation of the
group-level frontier models. When |
scaling |
Logical. Applicable only when |
modelType |
Character string. Applicable only when
|
groupType |
Character string. Type of frontier model estimated for each technology group. Three options are available:
|
metaMethod |
Character string. Method for estimating the global metafrontier that envelopes all group frontiers. Three options are available:
|
sfaApproach |
Character string. Applicable only when
|
selectionF |
A two-sided formula specifying the sample selection
equation, e.g., |
lcmClasses |
Integer. Number of latent classes to be estimated per group
when |
whichStart |
Integer. Strategy for obtaining starting values in the
latent class model (
|
initAlg |
Character string. Optimisation algorithm used during the
initialisation of the latent class model when |
initIter |
Integer. Maximum number of iterations for the initialisation
algorithm when |
lType |
Character string. Specifies how the likelihood is evaluated for
the selection model (
|
Nsub |
Integer. Number of quadrature nodes or integration subdivisions
when |
uBound |
Numeric. Upper bound for the numerical integration of the
inefficiency component when |
intol |
Numeric. Integration tolerance for the quadrature approaches
|
method |
Character string. Optimisation algorithm for the main ML/MSL
estimation of each group-level frontier model. Default
|
hessianType |
Integer. Specifies which Hessian is returned for the
group-level frontier estimation. The accepted values match those of the
underlying
When |
simType |
Character string. Simulation method for maximum simulated
likelihood (MSL). Applicable to
|
Nsim |
Integer. Number of simulation draws for MSL. Default |
prime |
Integer. Prime number used to construct Halton or
Generalised-Halton sequences. Default |
burn |
Integer. Number of leading draws discarded from the Halton
sequence to reduce serial correlation. Default |
antithetics |
Logical. If |
seed |
Integer. Random seed for simulation draws, ensuring
reproducibility of MSL estimates. Default |
itermax |
Integer. Maximum number of iterations for the main
optimisation. Default |
printInfo |
Logical. If |
tol |
Numeric. Convergence tolerance. The algorithm is considered
converged when the change in the log-likelihood between successive
iterations is smaller than |
gradtol |
Numeric. Gradient convergence tolerance. The algorithm is
considered converged when the Euclidean norm of the gradient is smaller
than |
stepmax |
Numeric. Maximum step length used by the |
qac |
Character string. Quadratic Approximation Correction for the
|
... |
Additional arguments passed through to the second-stage SFA
call when |
x |
An object of class |
groupType = "sfacross")The stochastic frontier model is defined as:
where is the output (cost, revenue, or profit),
is the vector of frontier regressors, is the one-sided
inefficiency term with variance , and is the
symmetric noise term with variance .
Estimation is by ML for all distributions except "gamma",
"lognormal", and "weibull", for which MSL is used with
Halton, Generalised-Halton, Sobol, or uniform draws. Antithetic draws are
available for the uniform case.
To account for heteroscedasticity, the variances are modelled as
and
. For the truncated normal
distribution, heterogeneity in the pre-truncation mean is modelled as
. The scaling property (Wang and
Schmidt, 2002) can also be imposed for the truncated normal.
groupType = "sfaselectioncross")This model extends the Heckman (1979) selection framework to the stochastic frontier setting (Greene, 2010; Dakpo et al., 2021). The selection and frontier equations are:
where is the binary selection
indicator and is observed only when
. Selection bias arises from
. Only selected observations
enter the frontier and metafrontier estimation; efficiency estimates for
non-selected observations are NA.
groupType = "sfalcmcross")The latent class model (Orea and Kumbhakar, 2004) estimates a finite
mixture of frontier models:
The prior class probability follows a logit specification:
Class assignment is based on the maximum posterior probability computed via
Bayes' rule. When group is omitted, a single pooled model is
estimated and class assignments serve as technology groups.
The global metafrontier envelopes all
group frontiers. With LP (Battese et al., 2004),
minimises
subject to . QP minimises the squared analogue. The
stochastic approaches (Huang et al., 2014; O'Donnell et al.,
2008) treat the technology gap as a one-sided error in a
second-stage SFA. Group and metafrontier efficiencies are:
Both Jondrow et al. (1982) and Battese and Coelli (1988) estimators
are provided for each measure. See efficiencies for details.
smfa returns an object of class
"smfa", which is a list containing:
call |
The matched call. |
groupModels |
A named list of fitted group-level frontier objects,
one per technology group. Each element is of class |
metaSfaObj |
The fitted metafrontier object. For
|
metaRes |
Estimated metafrontier coefficients (with standard errors,
z-values, and p-values for |
formula |
The |
metaMethod |
The metafrontier estimation method used. |
sfaApproach |
The second-stage SFA approach; |
groupType |
The type of group-level frontier model estimated. |
group |
The name of the grouping variable. |
groups |
Character vector of unique group labels. |
S |
The frontier orientation ( |
dataTable |
The data used in estimation, augmented with
|
lcmNoGroup |
Logical. |
lcmObj |
When |
Aigner, D. J., Lovell, C. A. K., and Schmidt, P. 1977. Formulation and estimation of stochastic frontier production function models. Journal of Econometrics, 6(1), 21–37. doi:10.1016/0304-4076(77)90052-5
Battese, G. E., and Coelli, T. J. 1988. Prediction of firm-level technical efficiencies with a generalized frontier production function and panel data. Journal of Econometrics, 38(3), 387–399. doi:10.1016/0304-4076(88)90053-X
Battese, G. E., Rao, D. S. P., and O'Donnell, C. J. 2004. A metafrontier production function for estimation of technical efficiencies and technology gaps for firms operating under different technologies. Journal of Productivity Analysis, 21(1), 91–103. doi:10.1023/B:PROD.0000012454.06094.29
Greene, W. 2003. Simulated likelihood estimation of the normal-gamma stochastic frontier function. Journal of Productivity Analysis, 19(2-3), 179–190. doi:10.1023/A:1022853416499
Greene, W. 2010. A stochastic frontier model with correction for sample selection. Journal of Productivity Analysis, 34(1), 15–24. doi:10.1007/s11123-009-0159-1
Hajargasht, G. 2015. Stochastic frontiers with a Rayleigh distribution. Journal of Productivity Analysis, 44(2), 199–208. doi:10.1007/s11123-014-0417-8
Heckman, J. J. 1979. Sample selection bias as a specification error. Econometrica, 47(1), 153–161. doi:10.2307/1912352
Huang, C. J., Huang, T.-H., and Liu, N.-H. 2014. A new approach to estimating the metafrontier production function based on a stochastic frontier framework. Journal of Productivity Analysis, 42(3), 241–254. doi:10.1007/s11123-014-0402-2
Jondrow, J., Lovell, C. A. K., Materov, I. S., and Schmidt, P. 1982. On the estimation of technical inefficiency in the stochastic frontier production function model. Journal of Econometrics, 19(2-3), 233–238. doi:10.1016/0304-4076(82)90004-5
Li, Q. 1996. Estimating a stochastic production frontier when the adjusted error is symmetric. Economics Letters, 52(3), 221–228. doi:10.1016/S0165-1765(96)00857-9
Meeusen, W., and van den Broeck, J. 1977. Efficiency estimation from Cobb-Douglas production functions with composed error. International Economic Review, 18(2), 435–444. doi:10.2307/2525757
Migon, H. S., and Medici, E. 2001. Bayesian inference for generalised exponential models. Working paper, Universidade Federal do Rio de Janeiro.
Nguyen, N. B. 2010. Estimation of technical efficiency in stochastic frontier analysis. PhD thesis, Bowling Green State University.
O'Donnell, C. J., Rao, D. S. P., and Battese, G. E. 2008. Metafrontier frameworks for the study of firm-level efficiencies and technology ratios. Empirical Economics, 34(2), 231–255. doi:10.1007/s00181-007-0119-4
Orea, L., and Kumbhakar, S. C. 2004. Efficiency measurement using a latent class stochastic frontier model. Empirical Economics, 29(1), 169–183. doi:10.1007/s00181-003-0184-2
Dakpo, K. H., Jeanneaux, P., and Latruffe, L. 2016. Modelling pollution-generating technologies in performance benchmarking: Recent developments, limits and future prospects in the nonparametric framework. European Journal of Operational Research, 250(2), 347–359. doi:10.1016/j.ejor.2015.07.024
Papadopoulos, A. 2015. The half-normal specification for the two-tier stochastic frontier model. Journal of Productivity Analysis, 43(2), 225–230. doi:10.1007/s11123-014-0389-8
Stevenson, R. E. 1980. Likelihood functions for generalised stochastic frontier estimation. Journal of Econometrics, 13(1), 57–66. doi:10.1016/0304-4076(80)90042-1
Dakpo, K. H., Latruffe, L., Desjeux, Y., and Jeanneaux, P. 2021. Latent class modelling for a robust assessment of productivity: Application to French grazing livestock farms. Journal of Agricultural Economics, 72(3), 760–781. doi:10.1111/1477-9552.12422
Dakpo, K. H., Latruffe, L., Desjeux, Y., and Jeanneaux, P. 2022. Modeling heterogeneous technologies in the presence of sample selection: The case of dairy farms and the adoption of agri-environmental schemes in France. Agricultural Economics, 53(3), 422–438. doi:10.1111/agec.12683
Tsionas, E. G. 2007. Efficiency measurement with the Weibull stochastic frontier. Oxford Bulletin of Economics and Statistics, 69(5), 693–706. doi:10.1111/j.1468-0084.2007.00475.x
Wang, H.-J. 2012. Stochastic frontier models. In A Companion to Theoretical Econometrics, ed. B. H. Baltagi, Blackwell, Oxford.
Wang, H.-J., and Schmidt, P. 2002. One-step and two-step estimation of the effects of exogenous variables on technical efficiency levels. Journal of Productivity Analysis, 18(2), 129–144. doi:10.1023/A:1016565719882
Dakpo, K. H., Desjeux, Y., and Latruffe, L. 2023. sfaR: Stochastic Frontier Analysis using R. R package version 1.0.1. https://CRAN.R-project.org/package=sfaR
sfacross, sfaselectioncross,
sfalcmcross, efficiencies,
summary.smfa, ic
########################################################################### ## -------- SECTION 1: Standard SFA Group Frontier ----------------------## ## Using the rice production dataset (ricephil) from Battese et al. ## ## Groups are formed based on farm area terciles (small/medium/large). ## ########################################################################### data("ricephil", package = "sfaR") ricephil$group <- cut(ricephil$AREA, breaks = quantile(ricephil$AREA, probs = c(0, 1 / 3, 2 / 3, 1), na.rm = TRUE), labels = c("small", "medium", "large"), include.lowest = TRUE ) ## 1a. sfacross groups + LP metafrontier ## Deterministic envelope via linear programming (Battese et al., 2004). meta_sfacross_lp <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "lp" ) summary(meta_sfacross_lp) # Retrieve individual efficiency and metatechnology ratio estimates: ef_lp <- efficiencies(meta_sfacross_lp) head(ef_lp) ## 1b. sfacross groups + QP metafrontier ## Deterministic envelope via quadratic programming. meta_sfacross_qp <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "qp" ) summary(meta_sfacross_qp) ## 1c. sfacross groups + Two-stage SFA metafrontier (Huang et al., 2014) ## The group-specific fitted frontier values serve as the dependent ## variable in the second-stage SFA, yielding a stochastic technology gap. meta_sfacross_huang <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "sfa", sfaApproach = "huang" ) summary(meta_sfacross_huang) ef_huang <- efficiencies(meta_sfacross_huang) head(ef_huang) ## 1d. sfacross groups + O'Donnell et al. (2008) stochastic metafrontier ## The LP deterministic envelope is used as the second-stage dependent ## variable: the metafrontier is estimated stochastically around the ## envelope. meta_sfacross_odonnell <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "sfa", sfaApproach = "ordonnell" ) summary(meta_sfacross_odonnell) ########################################################################### ## -------- SECTION 2: Latent Class (LCM) Group Frontier ---------------## ## No observed group variable: a pooled sfalcmcross model assigns ## ## observations to 2 latent technology classes; these classes become the ## ## technology groups for the metafrontier. ## ########################################################################### data("utility", package = "sfaR") ## 2a. sfalcmcross (pooled, 2 classes) + LP metafrontier meta_lcm_lp <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "lp" ) summary(meta_lcm_lp) ef_lcm_lp <- efficiencies(meta_lcm_lp) head(ef_lcm_lp) ## 2b. sfalcmcross (pooled, 2 classes) + QP metafrontier meta_lcm_qp <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "qp" ) summary(meta_lcm_qp) ## 2c. sfalcmcross (pooled, 2 classes) + Two-stage SFA metafrontier ## (Huang et al., 2014) meta_lcm_huang <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "sfa", sfaApproach = "huang" ) summary(meta_lcm_huang) ef_lcm_huang <- efficiencies(meta_lcm_huang) head(ef_lcm_huang) ## 2d. sfalcmcross (pooled, 2 classes) + O'Donnell et al. (2008) meta_lcm_odonnell <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "sfa", sfaApproach = "ordonnell" ) summary(meta_lcm_odonnell) ########################################################################### ## -------- SECTION 3: Sample Selection SFA Group Frontier -------------## ########################################################################### ## 3a. Small toy example for automatic testing (< 5s) N <- 100 set.seed(12345) z1 <- rnorm(N); v1 <- rnorm(N); g <- rnorm(N) ds <- z1 + v1; d <- ifelse(ds > 0, 1, 0) group <- ifelse(g > 0, 1, 0) x1 <- rnorm(N); y <- x1 + rnorm(N) - abs(rnorm(N)) dat <- data.frame(y = y, x1 = x1, z1 = z1, d = d, group = group) meta_toy <- smfa( formula = y ~ x1, selectionF = d ~ z1, data = dat, group = "group", groupType = "sfaselectioncross", lType = "ghermite", Nsub = 10, itermax = 100, metaMethod = "lp" ) summary(meta_toy) ## 3b. More complex selection models ## Simulated dataset with a Heckman selection mechanism. N <- 2000 set.seed(12345) z1 <- rnorm(N); z2 <- rnorm(N); v1 <- rnorm(N); v2 <- rnorm(N); g <- rnorm(N) e1 <- v1; e2 <- 0.7071 * (v1 + v2) ds <- z1 + z2 + e1; d <- ifelse(ds > 0, 1, 0) group <- ifelse(g > 0, 1, 0) u <- abs(rnorm(N)); x1 <- rnorm(N); x2 <- rnorm(N) y <- x1 + x2 + e2 - u dat <- data.frame(y = y, x1 = x1, x2 = x2, z1 = z1, z2 = z2, d = d, group = group) meta_sel_lp <- smfa( formula = y ~ x1 + x2, selectionF = d ~ z1 + z2, data = dat, group = "group", S = 1L, udist = "hnormal", groupType = "sfaselectioncross", modelType = "greene10", lType = "kronrod", Nsub = 100, metaMethod = "lp" ) summary(meta_sel_lp)########################################################################### ## -------- SECTION 1: Standard SFA Group Frontier ----------------------## ## Using the rice production dataset (ricephil) from Battese et al. ## ## Groups are formed based on farm area terciles (small/medium/large). ## ########################################################################### data("ricephil", package = "sfaR") ricephil$group <- cut(ricephil$AREA, breaks = quantile(ricephil$AREA, probs = c(0, 1 / 3, 2 / 3, 1), na.rm = TRUE), labels = c("small", "medium", "large"), include.lowest = TRUE ) ## 1a. sfacross groups + LP metafrontier ## Deterministic envelope via linear programming (Battese et al., 2004). meta_sfacross_lp <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "lp" ) summary(meta_sfacross_lp) # Retrieve individual efficiency and metatechnology ratio estimates: ef_lp <- efficiencies(meta_sfacross_lp) head(ef_lp) ## 1b. sfacross groups + QP metafrontier ## Deterministic envelope via quadratic programming. meta_sfacross_qp <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "qp" ) summary(meta_sfacross_qp) ## 1c. sfacross groups + Two-stage SFA metafrontier (Huang et al., 2014) ## The group-specific fitted frontier values serve as the dependent ## variable in the second-stage SFA, yielding a stochastic technology gap. meta_sfacross_huang <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "sfa", sfaApproach = "huang" ) summary(meta_sfacross_huang) ef_huang <- efficiencies(meta_sfacross_huang) head(ef_huang) ## 1d. sfacross groups + O'Donnell et al. (2008) stochastic metafrontier ## The LP deterministic envelope is used as the second-stage dependent ## variable: the metafrontier is estimated stochastically around the ## envelope. meta_sfacross_odonnell <- smfa( formula = log(PROD) ~ log(AREA) + log(LABOR) + log(NPK), data = ricephil, group = "group", S = 1, udist = "hnormal", groupType = "sfacross", metaMethod = "sfa", sfaApproach = "ordonnell" ) summary(meta_sfacross_odonnell) ########################################################################### ## -------- SECTION 2: Latent Class (LCM) Group Frontier ---------------## ## No observed group variable: a pooled sfalcmcross model assigns ## ## observations to 2 latent technology classes; these classes become the ## ## technology groups for the metafrontier. ## ########################################################################### data("utility", package = "sfaR") ## 2a. sfalcmcross (pooled, 2 classes) + LP metafrontier meta_lcm_lp <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "lp" ) summary(meta_lcm_lp) ef_lcm_lp <- efficiencies(meta_lcm_lp) head(ef_lcm_lp) ## 2b. sfalcmcross (pooled, 2 classes) + QP metafrontier meta_lcm_qp <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "qp" ) summary(meta_lcm_qp) ## 2c. sfalcmcross (pooled, 2 classes) + Two-stage SFA metafrontier ## (Huang et al., 2014) meta_lcm_huang <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "sfa", sfaApproach = "huang" ) summary(meta_lcm_huang) ef_lcm_huang <- efficiencies(meta_lcm_huang) head(ef_lcm_huang) ## 2d. sfalcmcross (pooled, 2 classes) + O'Donnell et al. (2008) meta_lcm_odonnell <- smfa( formula = log(tc / wf) ~ log(y) + log(wl / wf) + log(wk / wf), data = utility, S = -1, groupType = "sfalcmcross", lcmClasses = 2, metaMethod = "sfa", sfaApproach = "ordonnell" ) summary(meta_lcm_odonnell) ########################################################################### ## -------- SECTION 3: Sample Selection SFA Group Frontier -------------## ########################################################################### ## 3a. Small toy example for automatic testing (< 5s) N <- 100 set.seed(12345) z1 <- rnorm(N); v1 <- rnorm(N); g <- rnorm(N) ds <- z1 + v1; d <- ifelse(ds > 0, 1, 0) group <- ifelse(g > 0, 1, 0) x1 <- rnorm(N); y <- x1 + rnorm(N) - abs(rnorm(N)) dat <- data.frame(y = y, x1 = x1, z1 = z1, d = d, group = group) meta_toy <- smfa( formula = y ~ x1, selectionF = d ~ z1, data = dat, group = "group", groupType = "sfaselectioncross", lType = "ghermite", Nsub = 10, itermax = 100, metaMethod = "lp" ) summary(meta_toy) ## 3b. More complex selection models ## Simulated dataset with a Heckman selection mechanism. N <- 2000 set.seed(12345) z1 <- rnorm(N); z2 <- rnorm(N); v1 <- rnorm(N); v2 <- rnorm(N); g <- rnorm(N) e1 <- v1; e2 <- 0.7071 * (v1 + v2) ds <- z1 + z2 + e1; d <- ifelse(ds > 0, 1, 0) group <- ifelse(g > 0, 1, 0) u <- abs(rnorm(N)); x1 <- rnorm(N); x2 <- rnorm(N) y <- x1 + x2 + e2 - u dat <- data.frame(y = y, x1 = x1, x2 = x2, z1 = z1, z2 = z2, d = d, group = group) meta_sel_lp <- smfa( formula = y ~ x1 + x2, selectionF = d ~ z1 + z2, data = dat, group = "group", S = 1L, udist = "hnormal", groupType = "sfaselectioncross", modelType = "greene10", lType = "kronrod", Nsub = 100, metaMethod = "lp" ) summary(meta_sel_lp)
Create and print summary results for stochastic metafrontier models returned by
smfa.
## S3 method for class 'smfa' summary(object, ...) ## S3 method for class 'summary.smfa' print(x, digits = max(3, getOption("digits") - 2), ...)## S3 method for class 'smfa' summary(object, ...) ## S3 method for class 'summary.smfa' print(x, digits = max(3, getOption("digits") - 2), ...)
object |
An object of class |
... |
Currently ignored. |
x |
An object of class |
digits |
Numeric. Number of digits displayed in values. |
The summary method returns a list of class
'summary.smfa'
that contains the same elements as an object returned by smfa
with the following additional elements:
AIC |
Akaike information criterion. |
BIC |
Bayesian information criterion. |
HQIC |
Hannan-Quinn information criterion. |
metaRes |
Matrix of metafrontier estimates, their standard errors, z-values, and asymptotic P-values. |
effStats |
A list of efficiency statistics including group means and class membership probabilities. |
grpSummaries |
A list of summary objects for each group model. |
smfa, for the stochastic metafrontier analysis model
fitting function for cross-sectional or pooled data.
vcov computes the variance-covariance matrix of the maximum
likelihood (ML) coefficients from stochastic metafrontier models estimated with
smfa.
## S3 method for class 'smfa' vcov(object, ...)## S3 method for class 'smfa' vcov(object, ...)
object |
A stochastic metafrontier model returned
by |
... |
Currently ignored |
The variance-covariance matrix is obtained by the inversion of the
negative Hessian matrix. Depending on the distribution and the
'hessianType' option, the analytical/numeric Hessian or the bhhh
Hessian is evaluated.
The variance-covariance matrix of the maximum likelihood coefficients is returned.
smfa, for the stochastic metafrontier analysis model
fitting function using cross-sectional or pooled data.