Codes
Nonparametric and Stochastic Efficiency and Productivity Analysis
R package 'npsf'
The nonparametric models in npsf comprise nonradial efficiency measurement (tenonradial), where non-proportional reductions (expansions) in each positive input (output) are allowed, as well as popular radial efficiency measurement (teradial), where movements to the frontier are proportional.
Using bootstrapping techniques, teradialbc, nptestrts, nptestind deal with statistical inference about the radial efficiency measurement.
Computer intensive functions teradialbc and nptestrts allow making use of parallel computing, even on a single machine with multiple cores.
The parametric stochastic frontier models in npsf can be estimated by sf, which performs maximum likelihood estimation of the frontier parameters and technical or cost efficiencies. Inefficiency error component can be assumed to be have either half-normal or truncated normal distribution. sf allows modelling multiplicative heteroskedasticity of either inefficiency or random noise component, or both. Additionally, marginal effects of exogenous variable(s) on the expected value of inefficiency term can be computed.
Further details at https://cran.r-project.org/web/packages/npsf
Other codes in R
Codes in R
R code (needs eff_m code) to run semi-automatic outlier detection procedure as in Simar, Léopold, "Detecting Outliers in Frontier Models: A Simple Approach," Journal of Productivity Analysis, 2003, 20, 391–424.
R code to conduct Instrumental Variable post-estimation (akin to Christopher Baum's `ivreg2' command in Stata. It does
(i) TESTS OF ENDOGENEITY
(ii) WEAKNESS OF THE INSTRUMENTS, that includes (a) First-stage regression summary statistics and (b) Shea's partial R-squared
(iii) WEAK IDENTIFICATION TEST that includes (a) Minimum eigenvalue statistic, Cragg-Donald Wald F statistic, (b) 2SLS relative bias, (c) 2SLS Size (maximal rejection rate) of nominal 5% Wald test, and
(iv) SARGAN STATISTIC (overidentification test of all instruments)
npsf package also estimates cross-sectional truncated regression in R. Both lower and upper truncation is allowed. Additionally, marginal (or conditional partial) effects are calculated
R code to estimate random effects ordered probit or random effects ordered logistic (logit) regression (akin to xtoprobit and xtologit commands from version 13 of Stata). You need to download the data tvsfpors in csv format here.
Send your comments to obadunenko at gmail.com