Title: | Econometric Production Analysis with Ray-Based Distance Functions |
---|---|
Description: | Econometric analysis of multiple-input-multiple-output production technologies with ray-based input distance functions as suggested by Price and Henningsen (2022): "A Ray-Based Input Distance Function to Model Zero-Valued Output Quantities: Derivation and an Empirical Application", <https://ideas.repec.org/p/foi/wpaper/2022_03.html>. |
Authors: | Arne Henningsen [aut, cre], Juan José Price [aut] |
Maintainer: | Arne Henningsen <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1-2 |
Built: | 2024-11-15 04:52:23 UTC |
Source: | https://github.com/micecon/micecondistray |
Calculate the dependent variable (logarithmic distance) of a ray-based input distance function (Price & Henningsen, forthcoming).
distRayCalc( xNames, yNames, zNames = NULL, sNames = NULL, coef, data, form = "tl", conDummy = NULL, fixThetas = FALSE )
distRayCalc( xNames, yNames, zNames = NULL, sNames = NULL, coef, data, form = "tl", conDummy = NULL, fixThetas = FALSE )
xNames |
a vector of character strings containing the names of the variables that indicate the input quantities. |
yNames |
a vector of two or more character strings containing the names of the variables that indicate the output quantities. |
zNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should be interacted with the input quantities and the angles of the output vector. |
sNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should not be interacted with the input quantities and the angles of the output vector. |
coef |
numeric vector containing the coefficients. |
data |
data frame containing the data. |
form |
a character string that indicates the functional form;
currently, |
conDummy |
an optional numeric vector indicating the positions
in argument |
fixThetas |
logical value that indicates whether undefined angles of the output should be ‘fixed’ if the last two or more output quantities are zero for some of the observations. |
A vector.
Arne Henningsen and Juan José Price
Price, J.J. & Henningsen, A. (forthcoming): A Ray-Based Input Distance Function to Model Zero-Valued Output Quantities: Derivation and an Empirical Application. Journal of Productivity Analysis.
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # Cobb-Douglas ray-based input distance function (with manually set parameters) appleProdFr86$logDistCD <- distRayCalc( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, coef = c( "(Intercept)" = -11.116, alpha_1 = 0.082, alpha_2 = 0.615, beta_1 = -0.031, beta_2 = -0.388 ), form = "cd" ) summary( appleProdFr86$logDistCD ) # Translog ray-based input distance function (with estimated parameters) estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) appleProdFr86$logDistTL <- distRayCalc( xNames = c( "qCap", "qLab", "qMat" ), yNames= c( "qApples", "qOtherOut" ), data = appleProdFr86, coef = coef( estTL ) ) summary( appleProdFr86$logDistTL )
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # Cobb-Douglas ray-based input distance function (with manually set parameters) appleProdFr86$logDistCD <- distRayCalc( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, coef = c( "(Intercept)" = -11.116, alpha_1 = 0.082, alpha_2 = 0.615, beta_1 = -0.031, beta_2 = -0.388 ), form = "cd" ) summary( appleProdFr86$logDistCD ) # Translog ray-based input distance function (with estimated parameters) estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) appleProdFr86$logDistTL <- distRayCalc( xNames = c( "qCap", "qLab", "qMat" ), yNames= c( "qApples", "qOtherOut" ), data = appleProdFr86, coef = coef( estTL ) ) summary( appleProdFr86$logDistTL )
Calculate distance elasticities and derivatives based on ray-based input distance functions (Price & Henningsen, forthcoming).
distRayEla( xNames, yNames, zNames = NULL, sNames = NULL, coef, data, form = "tl", conDummy = NULL, fixThetas = FALSE, ... ) distRayDeriv( xNames, yNames, zNames = NULL, sNames = NULL, coef, data, form = "tl", conDummy = NULL, fixThetas = FALSE, numDeriv = FALSE, eps = 1e-6 )
distRayEla( xNames, yNames, zNames = NULL, sNames = NULL, coef, data, form = "tl", conDummy = NULL, fixThetas = FALSE, ... ) distRayDeriv( xNames, yNames, zNames = NULL, sNames = NULL, coef, data, form = "tl", conDummy = NULL, fixThetas = FALSE, numDeriv = FALSE, eps = 1e-6 )
xNames |
a vector of character strings containing the names of the variables that indicate the input quantities. |
yNames |
a vector of two or more character strings containing the names of the variables that indicate the output quantities. |
zNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should be interacted with the input quantities and the angles of the output vector. |
sNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should not be interacted with the input quantities and the angles of the output vector. |
coef |
numeric vector containing the coefficients. |
data |
data frame containing the data. |
form |
a character string that indicates the functional form;
currently, |
conDummy |
an optional numeric vector indicating the positions
in argument |
fixThetas |
logical value that indicates whether undefined angles of the output should be ‘fixed’ if the last two or more output quantities are zero for some of the observations. |
numDeriv |
logical value that indicates whether derivatives (and elasticities) should be calculated by numerical finite-difference differentiation. |
eps |
small positive value that is used as change in the variables when calculating derivatives (and elasticities) by numerical finite-difference differentiation. |
... |
further arguments of |
A list that will be described here later.
Arne Henningsen and Juan José Price
Price, J.J. & Henningsen, A. (forthcoming): A Ray-Based Input Distance Function to Model Zero-Valued Output Quantities: Derivation and an Empirical Application. Journal of Productivity Analysis.
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # estimate Translog ray-based input distance function estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) summary( estTL ) # calculate elasticities ela <- distRayEla( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), coef = coef( estTL ), data = appleProdFr86 ) summary( ela ) # calculate derivatives deriv <- distRayDeriv( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), coef = coef( estTL ), data = appleProdFr86 ) summary( deriv )
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # estimate Translog ray-based input distance function estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) summary( estTL ) # calculate elasticities ela <- distRayEla( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), coef = coef( estTL ), data = appleProdFr86 ) summary( ela ) # calculate derivatives deriv <- distRayDeriv( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), coef = coef( estTL ), data = appleProdFr86 ) summary( deriv )
Empirically analyse multiple-input-multiple-output production technologies by estimating a ray-based input distance function (Price & Henningsen, forthcoming).
distRayEst( xNames, yNames, zNames = NULL, sNames = NULL, data, form = "tl", method = "sfa", fixThetas = FALSE, ... )
distRayEst( xNames, yNames, zNames = NULL, sNames = NULL, data, form = "tl", method = "sfa", fixThetas = FALSE, ... )
xNames |
a vector of character strings containing the names of the variables that indicate the input quantities. |
yNames |
a vector of two or more character strings containing the names of the variables that indicate the output quantities. |
zNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should be interacted with the input quantities and the angles of the output vector. |
sNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should not be interacted with the input quantities and the angles of the output vector. |
data |
data frame containing the data. |
form |
a character string that indicates the functional form;
currently, |
method |
a character string that indicates the estimation method;
currently, |
fixThetas |
logical value that indicates whether undefined angles of the output should be ‘fixed’ if the last two or more output quantities are zero for some of the observations. |
... |
further arguments of |
A list that will be described here later.
Arne Henningsen and Juan José Price
Price, J.J. & Henningsen, A. (forthcoming): A Ray-Based Input Distance Function to Model Zero-Valued Output Quantities: Derivation and an Empirical Application. Journal of Productivity Analysis.
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # Cobb-Douglas ray-based input distance function estCD <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, form = "cd" ) summary( estCD ) # Translog ray-based input distance function estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) summary( estTL )
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # Cobb-Douglas ray-based input distance function estCD <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, form = "cd" ) summary( estCD ) # Translog ray-based input distance function estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) summary( estTL )
Create a matrix and vector for imposing monotonicity on a ray-based input distance function (Price & Henningsen, forthcoming).
distRayMonoRestr( xNames, yNames, zNames = NULL, sNames = NULL, data, form = "tl", conDummy = NULL )
distRayMonoRestr( xNames, yNames, zNames = NULL, sNames = NULL, data, form = "tl", conDummy = NULL )
xNames |
a vector of character strings containing the names of the variables that indicate the input quantities. |
yNames |
a vector of two or more character strings containing the names of the variables that indicate the output quantities. |
zNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should be interacted with the input quantities and the angles of the output vector. |
sNames |
an optional vector of character strings containing the names of ‘environmental’ variables, i.e., variables that affect the production possibility set (i.e., the feasible combinations of input-output quantities) that—in the case of a Translog functional form—should not be interacted with the input quantities and the angles of the output vector. |
data |
data frame containing the data. |
form |
a character string that indicates the functional form;
currently, |
conDummy |
an optional numeric vector indicating the positions
in argument |
A list that contains a matrix (RMat
)
and a vector (rVec
).
Arne Henningsen and Juan José Price
Price, J.J. & Henningsen, A. (forthcoming): A Ray-Based Input Distance Function to Model Zero-Valued Output Quantities: Derivation and an Empirical Application. Journal of Productivity Analysis.
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # Cobb-Douglas ray-based input distance function (with manually set parameters) estCD <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, form = "cd" ) summary( estCD ) # the vector of unrestricted coefficients and their covariance matrix nCoefCD <- length( coef( estCD ) ) - 2 uCoefCD <- coef( estCD )[ 1:nCoefCD ] uCovInvCD <- solve( vcov( estCD )[ 1:nCoefCD, 1:nCoefCD ] ) # obtain the matrix and vector to impose monotonicity restrCD <- distRayMonoRestr( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, form = "cd" ) # obtain the restricted coefficients library( "quadprog" ) minDistCD <- solve.QP( Dmat = uCovInvCD, dvec = rep( 0, nCoefCD ), Amat = t( restrCD$RMat ), bvec = - restrCD$RMat %*% uCoefCD + restrCD$rVec ) rCoefCD <- minDistCD$solution + uCoefCD # Translog ray-based input distance function (with estimated parameters) estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) appleProdFr86$logDistTL <- distRayCalc( xNames = c( "qCap", "qLab", "qMat" ), yNames= c( "qApples", "qOtherOut" ), data = appleProdFr86, coef = coef( estTL ) ) summary( appleProdFr86$logDistTL ) # the vector of unrestricted coefficients and their covariance matrix nCoefTL <- length( coef( estTL ) ) - 2 uCoefTL <- coef( estTL )[ 1:nCoefTL ] uCovInvTL <- solve( vcov( estTL )[ 1:nCoefTL, 1:nCoefTL ] ) # obtain the matrix and vector to impose monotonicity restrTL <- distRayMonoRestr( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) # obtain the restricted coefficientslibrary( "quadprog" ) minDistTL <- solve.QP( Dmat = uCovInvTL, dvec = rep( 0, nCoefTL ), Amat = t( restrTL$RMat ), bvec = - restrTL$RMat %*% uCoefTL + restrTL$rVec ) rCoefTL <- minDistTL$solution + uCoefTL
# load and prepare data set data( appleProdFr86, package = "micEcon" ) appleProdFr86$qCap <- appleProdFr86$vCap / appleProdFr86$pCap appleProdFr86$qLab <- appleProdFr86$vLab / appleProdFr86$pLab appleProdFr86$qMat <- appleProdFr86$vMat / appleProdFr86$pMat # Cobb-Douglas ray-based input distance function (with manually set parameters) estCD <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, form = "cd" ) summary( estCD ) # the vector of unrestricted coefficients and their covariance matrix nCoefCD <- length( coef( estCD ) ) - 2 uCoefCD <- coef( estCD )[ 1:nCoefCD ] uCovInvCD <- solve( vcov( estCD )[ 1:nCoefCD, 1:nCoefCD ] ) # obtain the matrix and vector to impose monotonicity restrCD <- distRayMonoRestr( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86, form = "cd" ) # obtain the restricted coefficients library( "quadprog" ) minDistCD <- solve.QP( Dmat = uCovInvCD, dvec = rep( 0, nCoefCD ), Amat = t( restrCD$RMat ), bvec = - restrCD$RMat %*% uCoefCD + restrCD$rVec ) rCoefCD <- minDistCD$solution + uCoefCD # Translog ray-based input distance function (with estimated parameters) estTL <- distRayEst( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) appleProdFr86$logDistTL <- distRayCalc( xNames = c( "qCap", "qLab", "qMat" ), yNames= c( "qApples", "qOtherOut" ), data = appleProdFr86, coef = coef( estTL ) ) summary( appleProdFr86$logDistTL ) # the vector of unrestricted coefficients and their covariance matrix nCoefTL <- length( coef( estTL ) ) - 2 uCoefTL <- coef( estTL )[ 1:nCoefTL ] uCovInvTL <- solve( vcov( estTL )[ 1:nCoefTL, 1:nCoefTL ] ) # obtain the matrix and vector to impose monotonicity restrTL <- distRayMonoRestr( xNames = c( "qCap", "qLab", "qMat" ), yNames = c( "qApples", "qOtherOut" ), data = appleProdFr86 ) # obtain the restricted coefficientslibrary( "quadprog" ) minDistTL <- solve.QP( Dmat = uCovInvTL, dvec = rep( 0, nCoefTL ), Amat = t( restrTL$RMat ), bvec = - restrTL$RMat %*% uCoefTL + restrTL$rVec ) rCoefTL <- minDistTL$solution + uCoefTL
The MuseumsDk
data set is a balanced panel data set
of 93 state-recognized museums in Denmark over a six years
(2012 and 2014-2018; 2013 is unavailable).
data( "MuseumsDk" )
data( "MuseumsDk" )
This data frame contains the following columns:
Name of the museum.
Type of museum (Kulturhistorisk museum = cultural history museum; Kunstmuseer = arts museum; Naturhistorisk museum = natural history museum; Blandet museum = mixed museum).
Municipality, in which the museum is located.
Year of the observation.
Number of visit sites.
Whether or not the museum has special responsibilities (0 = no special responsibilities; 1 = at least one special responsibility).
Number of (physical) visitors.
Number of articles published (archeology).
Number of articles published (cultural history).
Number of articles published (art history).
Number of articles published (natural history).
Number of temporary exhibitions.
Number of primary school classes on educational visits to the museum.
Number of events other than exhibitions.
Scientific labor (full-time equivalents).
Non-scientific labor (full-time equivalents).
Running and maintenance costs [1,000 DKK].
Conservation expenditure [1,000 DKK].
Consumer Price Index in Denmark (the value for year 2014 is set to 1).
A subset of this data set is used for the empirical analysis in Price & Henningsen (forthcoming). It has been obtained from Statistics Denmark and the Danish Ministry of Culture.
Price, J.J. & Henningsen, A. (forthcoming): A Ray-Based Input Distance Function to Model Zero-Valued Output Quantities: Derivation and an Empirical Application. Journal of Productivity Analysis.