Learn R Programming

npsf (version 0.8.0)

nptestrts: Nonparametric Test of Returns to Scale

Description

Routine nptestrts performs nonparametric tests the returns to scale of the underlying technology via bootstrapping techniques.

Usage

nptestrts(formula, data, subset,
 base = c("output", "input"),
 homogeneous = TRUE, test.two = TRUE,
 reps = 999, alpha = 0.05,
 core.count = 1, cl.type = c("SOCK", "MPI"),
 print.level = 1, dots = TRUE)

Arguments

formula

an object of class ``formula'' (or one that can be coerced to that class): a symbolic description of the model. The details of model specification are given under `Details'.

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment (formula), typically the environment from which teradial is called.

subset

an optional vector specifying a subset of observations for which technical efficiency is to be computed.

base

character or numeric. string: first letter of the word ``o'' for computing output-based or ``i'' for computing input-based technical efficiency measure. string: 2 for computing output-based or 1 for computing input-based technical efficiency measure

homogeneous

logical. If TRUE, the reference set is bootstrapped with homogeneous smoothing; if FALSE, the reference set is bootstrapped with heterogeneous smoothing.

test.two

logical. If TRUE, test 2, where efficiency measures under assumption of non-increasing and variable returns to scale technology are compared; if FALSE, nptestrts stops after test 1 is completed.

reps

specifies the number of bootstrap replications to be performed. The default is 999. The minimum is 100. Adequate estimates of confidence intervals using bias-corrected methods typically require 1,000 or more replications.

alpha

sets significance level; default is alpha=0.05.

core.count

positive integer. Number of cluster nodes. If core.count=1, the process runs sequentially. See performParallel in package snowFT for more details.

cl.type

Character string that specifies cluster type (see makeClusterFT in package snowFT). Possible values are 'MPI' and 'SOCK' ('PVM' is currently not available). See performParallel in package snowFT for more details.

dots

logical. Relevant if print.level>=1. If TRUE, one dot character is displayed for each successful replication; if FALSE, display of the replication dots is suppressed.

print.level

numeric. 0 - nothing is printed; 1 - print summary of the model and data. 2 - print summary of technical efficiency measures. 3 - print estimation results observation by observation. Default is 1.

Value

nptestrts returns a list of class npsf containing the following elements:

K

numeric: number of data points.

M

numeric: number of outputs.

N

numeric: number of inputs.

rts

string: RTS assumption.

base

string: base for efficiency measurement.

reps

numeric: number of bootstrap replications.

alpha

numeric: significance level.

teCrs

numeric: measures of technical efficiency under the assumption of CRS.

teNrs

numeric: measures of technical efficiency under the assumption of NiRS.

teVrs

numeric: measures of technical efficiency under the assumption of VRS.

sefficiency

numeric: scale efficiency.

sefficiencyMean

numeric: ratio of means of technical efficiency measures under CRS and VRS.

pGlobalCRS

numeric: p-value of the test that the technology is globally CRS.

psefficient

numeric: p-value of the test that data point is statistically scale efficient.

sefficient

logical: returns TRUE, if statistically scale efficient; FALSE otherwise.

nsefficient

numeric: number of statistically scale efficient.

nrsOVERvrsMean

numeric: ratio of means of technical efficiency measures under NIRS and VRS (if test.two=TRUE).

pGlobalNRS

numeric: p-value of the test the technology is globally NIRS (if test.two=TRUE).

sineffdrs

logical: returns TRUE if statistically scale inefficient due to DRS and FALSE if statistically scale inefficient due to IRS (if test.two=TRUE and not all data points are statistically scale efficient nsefficient<K).

pineffdrs

numeric: p-value of the test that data point is scale inefficient due to DRS (if test.two=TRUE and not all data points are statistically scale efficient nsefficient<K).

nrsOVERvrs

numeric: ratio of measures of technical efficiency under NiRS and VRS (if test.two=TRUE and not all data points are statistically scale efficient nsefficient<K).

esample

logical: returns TRUE if the observation in user supplied data is in the estimation subsample and FALSE otherwise.

Details

Routine nptestrts performs nonparametric tests the returns to scale of the underlying technology (see Simar L. and P.W. Wilson (2002), Nonparametric Tests of Return to Scale, European Journal of Operational Research, 139, 115--132, 10.1016/S0377-2217(01)00167-9).

If test.two is not specified, nptestrts performs only Test #1, which consists of two parts. First, the null hypothesis that the technology is globally CRS (vs VRS) is tested. Second, the null hypothesis that the data point is scale efficient is tested.

If test.two is specified, nptestrts may perform Test #2. If the null hypothesis that the technology is CRS is rejected, test.two requests that nptestrts tests the null hypothesis that the technology is NIRS (vs VRS). If not all data points are scale efficient, nptestrts tests that the reason for scale inefficiency is DRS. If the null hypothesis that the technology is CRS is not rejected and all data points are scale efficient, nptestrts will not perform Test #2 even if test.two is specified.

Models for nptestrts are specified symbolically. A typical model has the form outputs ~ inputs, where outputs (inputs) is a series of (numeric) terms which specifies outputs (inputs). Refer to the examples.

If core.count>=1, nptestrts will perform bootstrap on multiple cores. Parallel computing requires package snowFT. By the default cluster type is defined by option cl.type="SOCK". Specifying cl.type="MPI" requires package Rmpi.

On some systems, specifying option cl.type="SOCK" results in much quicker execution than specifying option cl.type="MPI". Option cl.type="SOCK" might be problematic on Mac system.

Parallel computing make a difference for large data sets. Specifying option dots=TRUE will indicate at what speed the bootstrap actually proceeds. Specify reps=100 and compare two runs with option core.count=1 and core.count>1 to see if parallel computing speeds up the bootstrap. For small samples, parallel computing may actually slow down the nptestrts.

Results can be summarized using summary.npsf.

References

Badunenko, O. and Mozharovskyi, P. (2016), Nonparametric Frontier Analysis using Stata, Stata Journal, 163, 550--89, 10.1177/1536867X1601600302

F<U+00E4>re, R. and Lovell, C. A. K. (1978), Measuring the technical efficiency of production, Journal of Economic Theory, 19, 150--162, 10.1016/0022-0531(78)90060-1

F<U+00E4>re, R., Grosskopf, S. and Lovell, C. A. K. (1994), Production Frontiers, Cambridge U.K.: Cambridge University Press, 10.1017/CBO9780511551710

Simar L. and P.W. Wilson (2002), Nonparametric Tests of Return to Scale, European Journal of Operational Research, 139, 115--132, 10.1016/S0377-2217(01)00167-9

See Also

teradial, tenonradial, teradialbc, tenonradialbc, nptestind, sf

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
require( npsf )

# Prepare data and matrices

data( ccr81 )
head( ccr81 )

# Create some missing values

ccr81 [64, "x4"] <- NA # just to create missing
ccr81 [68, "y2"] <- NA # just to create missing

Y2 <- as.matrix( ccr81[ , c("y1", "y2", "y3"), drop = FALSE] )
X2 <- as.matrix( ccr81[ , c("x1", "x2", "x3", "x4", "x5"), drop = FALSE] )

# Perform output-based test of returns to scale smoothed 
# homogeneous bootstrap with 999 replications at the 5<!-- %  -->
# significance level.  Also perform Test #2

t1 <- nptestrts(y1 + y2 + y3 ~ x1 + x2 + x3 + x4 + x5,
	data = ccr81, homogeneous = TRUE,
	reps = 999, dots = TRUE, base = "o")

# suppress printing replication dots
t2 <- nptestrts(Y2 ~ X2,
	homogeneous = TRUE,
	reps = 100, dots = FALSE, base = "o")


# heterogeneous
t3 <- nptestrts(Y2 ~ X2,
	homogeneous = FALSE,
	reps = 100, dots = TRUE, base = "o")


# ===========================
# ===  Parallel computing ===
# ===========================

# Perform previous test but use 8 cores and
# cluster type SOCK

t3 <-  nptestrts(y1 + y2 + y3 ~ x1 + x2 + x3 + x4 + x5,
	data = ccr81, homogeneous = FALSE,
	reps = 100, dots = TRUE, base = "o",
	core.count = 8, cl.type = "SOCK")


# Really large data-set

data(usmanuf)
head(usmanuf)

nrow(usmanuf)
table(usmanuf$year)

# Figure industries to include in the sample (first quarter)

summary(usmanuf[usmanuf$year >= 1999 & usmanuf$year < 2000, "naics"])

# This test is quite demanding and it will take some time
# depending on computer power

t4 <- nptestrts(Y ~ K + L + M, data = usmanuf,
	subset = year >= 1999 & year < 2000 & naics < 321900,
	homogeneous = FALSE, reps = 100, dots = TRUE, base = "o",
	core.count = 8, cl.type = "SOCK")

# This is very computer intensive task

t5 <- nptestrts(Y ~ K + L + M, data = usmanuf,
	subset = year >= 1999 & year < 2000,
	homogeneous = FALSE, reps = 100, dots = TRUE, base = "o",
	core.count = 8, cl.type = "SOCK")

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab