*! version 1.1 2may2016
help simarwilson

Title

simarwilson -- Simar & Wilson (2007) two-stage efficiency analysis

Syntax

simarwilson [(outputs = inputs)] [depvar] indepvars [if] [in] [weight], [options]

DEA score and regressors

Model
outputs list of output variables for DEA

inputs list of input variables for DEA

depvar DEA efficiency scores estimated beforehand

indepvars explanatory variables

options

Main
algorithm(1|2) algorithm 1 or 2; algorithm(1) is the default

notwosided always use one-sided truncated regression

logscore use log-efficiency as left-hand-side variable

nounit depvar > 1 indicates inefficiency (rarely required)

DEA/teradial
rts(crs|nirs|vrs) returns to scale assumption; rts(crs) is the default

base(output|input) consider output or input oriented efficiency; base(output) is the default

reference(varname) binary (0/1) indicator varname to specify refrence set

invert calculate inverse Farrell, that is Shephard, efficiency scores

tename(newvar) generate variable newvar with DEA efficiency score

tebc(newvar) generate variable newvar with bias-corrected DEA efficiency score

biaste(newvar) generate variable newvar with estimated bias of DEA efficiency score

SE/Bootstrap
reps(#) number of bootstrap replications; reps(1000) is the default

bcreps(#) number of bootstrap replications for bias correction; bcreps(100) is the default

saveall(name) save all bootstrap coefficient estimates as mata matrix name

bcsaveall(name) save all bootstrap efficiency scores as mata matrix name

dots display replication dots

Reporting
cinormal display normal-approximate confidence intervals

bbootstrap display mean bootstrap coefficient vector

level(#) set confidence level; default as set by set level

noomitted do not display omitted collinear variables

baselevels display base levels of factor variables

noprint suppress display of a warnings

nodeaprint suppress display of DEA output

trnoisily display genuine output of initial truncated regressions

indepvars may contain factor variables; see fvvarlist.

maximize_options are the same as for truncreg.

bootstrap is technically allowed with externally estimated efficiency scores depvar, however using the prefix command is entirely counterproductive; by and svy are not allowed; see prefix.

pweights and iweights are allowed, with the former being the default. fweights and aweights are not allowed; see weight. Unlike
if and in, which affect the samples used for truncated regression and DEA uniformly, weights are immaterial for DEA within simarwilson
and only affect the truncated regressions within simarwilson. In consequence, zero weights can be used for excluding observations from the truncated regression steps of
simarwilson that are still considered in the DEA steps. If iweights are used, numbers of observations are expressed in terms of rounded sums of weights.

The available postestimation commands are (almost) the same as for truncreg; see
[R] truncreg postestimation. One has to be careful in interpreting the results of the postestimation commands
since the underlying models for simarwilson and truncreg are not the same.

Description

simarwilson implements the procedures proposed by Simar and Wilson (2007) for regression analysis of DEA (data envelopment analysis)
efficiency scores. Unlike naive two-step approaches, the Simar and Wilson procedure accounts for (i) DEA efficiency scores being bounded - depending
on how inefficiency is defined - from above or from below at the value of one, and (ii) for DEA generating a complex and generally unknown
correlation pattern among estimated efficiency scores. In technical terms a multi-step procedure is pursued that involves (i) estimation of a radial measure
of technical efficiency, (ii) truncated regression analysis, (iii) simulating the unknown error correlation, and (iv) calculating bootstrap standard errors and CIs. From a purely technical perspective, one may interpret simarwilson
as a procedure for correcting the standard errors one gets from using truncreg for regressing DEA scores on explanatory variables. Simar and Wilson (2007) propose two algorithms (alg. #1 and alg. #2)
that differ in either using uncorrected (alg. #1) or bias-corrected (alg. #2) efficiency scores. Both algorithms are implemented. simarwilson allows for either using externally estimated
DEA scores (spec. depvar) or for internally conducting the DEA (sepc. (outputs = inputs)). For the latter simarwilson requires the user-written command teradial (Badunenko and Mozharovskyi, 2016).
Note that the procedure for bias correction suggested in Simar & Wilson (2007) - though similar - deviates from what is implemented in the user-written program
teradialbc (Badunenko and Mozharovskyi, 2016) and is closely linked to the regression analysis on the second stage of the procedure.
For this reason, it is recommended not to use externally estimated scores, if one wants to apply algorithm #2.

DEA, externally estimated efficiency scores, and regressors

Model

outputs specifies the list of outputs from the production process under scrutiny. outputs may only include numeric, non-negative variables. Factor variables are not allowed in outputs.
The number of output and input variables must not exceed the number of considered DMUs. outputs and inputs must be mutually exclusive.

inputs specifies the list of inputs to the production process under scrutiny. inputs may only include numeric, non-negative variables. Factor variables are not allowed in inputs.
The number of output and input variables must not exceed the number of considered DMUs. outputs and inputs must be mutually exclusive.

depvar specifies an existing variable that contains an externally estimated efficiency measure (score), meant to enter the regression model as dependent variable.
Specifying depvar is only possible, if (outputs = inputs) is not specified. That means, with (outputs = inputs) specified,
any variable in the following varlist is interpreted as element of indepvars. simarwilson expects depvar to be a radial efficiency measure that is either bounded to the (0,1] interval
or to the [1,+inf) interval. If some values of depvar are smaller than one while others exceed one, simarwilson issues a warning and ignores observations, depending on how nounit is specified. This may
happen if the DEA was carried out using a reference set that does not include all observations for which efficiency scores are estimated.
Note that Simar & Wilson (2007) do not consider this case. Only numeric and strictly positive values are not allowed for depvar.

indepvars specifies the list of regressors.

Options

Main

algorithm(1|2) specifies whether algorithm #1 or algorithm #2 is applied. In order to calculate bias-corrected efficiency scores, algorithm #2 involves another bootstrap procedure, that loops over DEA.
algorithm(2), hence, requires (outputs = inputs) to be specified. If one uses external DEA scores as depvar, one has to opt for algorithm(1) even if the externally estimated scores are bias-corrected.
algorithm(1) is the default.

notwosided makes simarwilson apply a one-sided truncated regression model, irrespective of whether (regular) efficiency scores are bounded to the (0,1] interval or in the [1,+infinity) interval.
For (regular) scores within (0,1] the default (twosided) is to use a two-sided truncated regression model and to sample from the two-sided truncated normal distribution. With twosided, the procedure
hence takes into account that (Farrell input oriented) efficiency scores are not only less than or equal to 1 but are also strictly positive. The latter is ignored with notwosided.
Hence, with notwosided, simarwilson mirror-inverted applies the procedure suggested in Simar and Wilson (2007), who only consider scores within [1,+infinity), to efficiency scores within (0,1].
For (regular) efficiency scores >= 1, specifying notwosided has no effect. notwosided is not recommended in with algorithm(2).

logscore makes simarwilson use the natural logarithm of the efficiency score as left-hand-side variable in the truncated regressions. With logscore specified, truncation is at 0 rather than at 1 and is always one-sided.
If externally estimated scores are use, do not take the logarithm beforehand, but let the original score enter the estimation procedure as depvar.

nounit specifies whether inefficiency is indicated by efficiency score < 1 (unit) or by efficiency score > 1 (nounit). Specifying this option will rarely be necessary.
If the DEA is carried out internally, simarwilson internally sets nounit depending on how base() and invert are specified. If externally estimated scores are used
and all observations of depvar are either in the (0,1] or in the [1,+infinity) interval, specifying the nounit option is also not required,
since simarwilson recognizes which DMUs are inefficient and which are efficient. Only if external scores are used that are neither bounded to the (0,1] interval nor to the [1,+infinity) interval,
nounit is required to specify which observation of depvar are regular (inefficient) ones and which are irregular (super-efficient) ones. Note that Simar & Wilson (2007) do not consider irregular (super-efficient) DMUs.

DEA/teradial

rts(crs|nirs|vrs) specifies under which assumption regarding the returns to scale of the considered production process, the measure of technical efficiency is estimated.
crs requests constant returns to scale, nirs requests non-increasing returns to scale, and vrs requests variable returns to scale. rts(crs) is the default.
rts() is passed through to teradial.

base(output|input) specifies orientation/base of the radial measure of technical efficiency. output requests output orientation while input requests input orientation.
base(output) is the default. base() is passed through to teradial.

reference(varname) specifies the indicator variable that defines which data points of outputs and inputs (DMUs) form the technology reference set.
varname may not take other values than 0 and 1, with the latter indicating being part of the reference set. Since for each reference DMU an efficiency score is required
when running simarwilson, the full set of DMUs or a subset of DMUs may serve as reference set. Yet, the reference set may not include any observations for which technical efficiency is not estimated.
This precludes the specification (ref_outputs = ref_inputs), which is allowed in teradial. Specifying a subset of observation as reference set will frequently result in
irregular (super-efficient) efficiency estimates. Note that Simar and Wilson (2007) consider the full set of observations as reference set. Specifying a subset as reference, hence, results in a DEA model
that substantially deviates from what is assumed in Simar and Wilson (2007).

invert makes simarwilson calculate and use the Shephard instead of the Farrell (default) efficiency measure, i.e. efficiency scores are inverted.
With option invert scores smaller than one indicate inefficiency for the output-oriented efficiency measures
(i.e. the factor by which output generation proportionally fall short of what is technically feasible) and scores larger than one indicate
inefficiency for the input-oriented efficiency measure (i.e. the factor by which input utilization proportionally exceeds what is technically feasible).
invert is redundant for base(crs) since for constant returns to scale input-oriented efficiency is just the reciprocal of output-oriented efficiency.
Hence rather than specifying invert one can just switch the base. Yet, this does not hold for base(nirs) and base(vrs).

tename(newvar) creates the new variable newvar that contains estimates of radial technical efficiency (DEA scores).

tebc(newvar) creates the new variable newvar that contains bias-corrected estimates of radial technical efficiency
(bias-corrected DEA scores). tebc(newvar) requires algorithm(2).

biaste(newvar) creates the new variable newvar that contains bootstrap bias estimate for original radial measures of technical efficiency.
biaste(newvar) requires algorithm(2).

SE/Bootstrap

reps(#) specifies the number of bootstrap replications for estimating CIs for the regression coefficients; the default is 1000 replications.

bcreps(#) specifies the number of bootstrap replications for bias correction of DEA scores; the default is 100 replications as suggested in Simar & Wilson (2007).

saveall(name) makes simarwilson save all bootstrap estimates of the regression coefficients to the (reps x K+1) mata matrix name.
Any existing mata matrix name is replaced.

bcsaveall(name) makes simarwilson save all bootstrap efficiency scores that are estimated in the bias-correction procedure to the (bcreps x N_dea)
mata matrix name. Any existing mata matrix name is replaced. Depending on bcreps(#) and the number of considered DMUs, the saved mata matrix may be huge.

dots makes simarwilson display one dot character for each bootstrap replication.

Reporting

cinormal makes simarwilson display normal-approximated confidence intervals rather than percentiles based bootstrap CIs
for the regression coefficients. One may change the reported type of CIs by retyping simarwilson without arguments and only
specifying the option cinormal.

bbootstrap makes simarwilson display mean bootstrap coefficients rather than the original coefficients from estimating the
truncated regression model. One may change the type of the reported coefficient vector by retyping simarwilson without
arguments and only specifying the option bbootstrap.

level(#); see [R] estimation options. One may change the reported confidence level by retyping
simarwilson without arguments and only specifying the option level(#). For percentiles based CIs this requires saveall(name).

noomitted specifies that variables that were omitted because of collinearity not be displayed. The default is to include in the table
any variables omitted because of collinearity and to label them as omitted by the "o." prefix.

baselevels makes simarwilson display base categories of factor variables in the table of results and label them as base by the "#b." prefix.

noprint prevents simarwilson from displaying warnings. Error messages are displayed irrespective of whether or not
noprint is specified.

nodeaprint prevents simarwilson from displaying DEA output.

trnoisily makes simarwilson display genuine output of truncreg for the initial truncated regression(s) (not for truncated regressions within bootstrap procedures).
Specifying this option might be useful if simarwilson issues the error message 'truncated regression failed' or 'convergence not achieved in truncated regression' and one tries to figure out what makes truncreg fail.

Examples

Preceding data envelopment analysis (input oriented, variable returns to scale)

. teradial output1 output2 = input1 input2, rts(vrs) base(i) tename(score)

Simar and Wilson (2007) analysis using externally estimated dea scores (algorithm #1)

. simarwilson score size i.ownership, reps(2000) dots

The same analysis as above (algorithm #1), with internal estimation of efficiency scores

. simarwilson (output1 output2 = input1 input2) size i.ownership, reps(2000) dots rts(vrs) base(i)

Simar and Wilson (2007) two-stage efficiency analysis with internal bias correction, i.e. algorithm #2

. simarwilson (output1 output2 = input1 input2) size i.ownership, algorithm(2) reps(2000) bcreps(1500) dots rts(vrs) base(i) saveall(BBSTR) tebc(bcscore)

Saved results

simarwilson saves the following in e():

Scalars

e(N) number of observations (inefficient DMUs)

e(N_lim) number of limit observations (efficient DMUs)

e(N_irreg) number of irregular observations (super-efficient DMUs)

e(N_all) overall number of observations (DMUs)

e(wgtsum) sum of weights (only saved if weights are specified)

e(sigma) estimate of sigma

e(ll) pseudo log-likelihood (initial truncated regression)

e(ic) number of iterations (initial truncated regression)

e(converged) 1 if converged, 0 otherwise (initial truncated regression)

e(rc) return code

e(k_eq) number of equations in e(b)

e(df_m) model degrees of freedom

e(k_aux) number of auxiliary parameters

e(chi2) model chi-squared

e(p) model significance, p-value

e(N_reps) number of complete bootstrap replications

e(N_misreps) number of incomplete bootstrap replications

e(level) confidence level

e(algorithm) algorithm used (1 or 2)

e(noutps) number of output variables

e(ninps) number of input variables

e(N_dea) number of DMUs for which efficiency scores are estimated

e(N_dearef) number of reference DMUs

e(N_deaneg) number of negative bias corrected scores

e(N_bc) number of complete bootstrap replications (bias correction)

Macros

e(title) Simar & Wilson (2007) two-stage efficiency analysis

e(shorttitle) Simar & Wilson (2007) eff. analysis

e(cmdline) command as typed

e(cmd) simarwilson

e(unit) either unit or nounit

e(truncation) either onesided or twosided

e(logscore) logscore if option logscore is specified

e(wtype) either pweight or iweight (only saved if weights are specified)

e(wexp) = exp (only saved if weights are specified)

e(depvarname) name of lhs variable (if provided as depvar or saved as newvar)

e(depvar) efficiency or inefficiency

e(saveall) name if option saveall(name) is specified

e(bcsaveall) name if option bcsaveall(name) is specified

e(cinormal) cinormal (if option cinormal is specified)

e(bbootstrap) bbootstrap (if option bbootstrap is specified)

e(scoretype) either score or bcscore

e(deatype) either internal or external

e(invert) either Farrell or Shephard

e(biaste) varname of estimated bias (if option biaste is specified}

e(tebc) varname of estimated bias-corrected efficiency (if option tebc is specified)

e(tename) varname of estimated uncorrected efficiency (if option tename is specified)

e(rts) returns to scale (CRS or NIRS or VRS)(if DEA is internal)

e(base) base/orientation (output or input)(if DEA is internal)

e(outputs) list of output variables (if DEA is internal)

e(inputs) list of input variables (if DEA is internal)

e(marginsok) predictions allowed by margins

e(marginsdefault) default predict() specification for margins

e(predict) program used to implement predict

e(properties) b V

Matrices

e(b) vector of estimated coefficients

e(V) estimated coefficient variance-covariance matrix

e(Cns) constraints matrix (if constraints are specified)

e(b_bstr) bootstrap estimates of coefficients

e(bias_bstr) bootstrap estimated biases

e(ci_percentile) bootstrap percentile CIs

Functions

e(sample) marks estimation sample (truncated regression)

References

Badunenko, O. and Mozharovskyi, P. (2016). Nonparametric frontier analysis using Stata. Stata Journal 16(3), 550-589.

Ji, Y. and Lee, C. (2010). Data envelopment analysis. Stata Journal 10(2), 267-280.

Simar, L. and Wilson, P. W. (2007). Estimation and inference in two-stage semi-parametric models of production processes. Journal of Econometrics 136, 31-64.

Also see

Manual: [R] truncreg

Help: [R] truncreg

Online: dea, teradial, teradialbc, nptestrts

Authors

Oleg Badunenko

University of Portsmouth

Portsmouth,
UK

E-mail: obadunenko@port.ac.uk

Harald Tauchmann

Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)

Nürnberg,
Germany

E-mail: harald.tauchmann@fau.de

Disclaimer

This software is provided "as is" without warranty of any kind, either expressed or implied. The entire risk as to the quality and
performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or
correction. In no event will the copyright holders or their employers, or any other party who may modify and/or redistribute this software,
be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to
use the program.

Acknowledgements

This work has been supported in part by the Collaborative Research Center "Statistical Modelling of Nonlinear Dynamic Processes" (SFB 823) of
the German Research Foundation (DFG). We gratefully acknowledge the comments and suggestions of Ramon Christen, Rita Maria Ribeiro
Bastiao, Akash Issar, Ana Claudia Sant'Anna, Jarmila Curtiss, Meir José Behar Mayerstain, Annika Herr, Hendrik Schmitz, Franziska Valder and participants of the German
Stata Users Group Meeting 2015.