quadFuncEla {micEcon} | R Documentation |
Elasticities of a Quadratic Function
Description
Calculate elasticities of a quadratic function.
Usage
quadFuncEla( xNames, data, coef, yName = NULL,
shifterNames = NULL, homWeights = NULL )
## S3 method for class 'quadFuncEst'
elas( object, data = NULL, yObs = FALSE, ... )
Arguments
xNames |
a vector of strings containing the names of the independent variables. |
data |
dataframe or a vector with named elements containing the data;
if argument |
coef |
vector containing all coefficients. |
yName |
an optional string containing the name of the dependent
variable.
If it is |
shifterNames |
an optional vector of strings containing the names of the independent variables that are included as shifters only (not in quadratic or interaction terms). |
homWeights |
numeric vector with named elements that are weighting factors
for calculating an index that is used to normalize the variables
for imposing homogeneity of degree zero in these variables
(see documentation of |
object |
object of class |
yObs |
logical. Use observed values of the endogenous variable.
If |
... |
currently ignored. |
Value
A data.frame of class quadFuncEla
,
where each column corresponds to one of the independent variables.
Author(s)
Arne Henningsen
See Also
quadFuncEst
, quadFuncDeriv
, and
quadFuncCalc
.
Examples
data( germanFarms )
# output quantity:
germanFarms$qOutput <- germanFarms$vOutput / germanFarms$pOutput
# quantity of variable inputs
germanFarms$qVarInput <- germanFarms$vVarInput / germanFarms$pVarInput
# a time trend to account for technical progress:
germanFarms$time <- c(1:20)
# estimate a quadratic production function
estResult <- quadFuncEst( yName = "qOutput",
xNames = c( "qLabor", "land", "qVarInput", "time" ),
data = germanFarms )
# compute the partial production elasticities with "fitted" output
elaFit <- quadFuncEla( xNames = c( "qLabor", "land", "qVarInput", "time" ),
data = germanFarms, coef = coef( estResult ) )
elaFit
# same as
elaFit2 <- elas( estResult )
all.equal( elaFit, elaFit2 )
# compute the partial production elasticities with observed output
elaObs <- quadFuncEla( xNames = c( "qLabor", "land", "qVarInput", "time" ),
data = germanFarms, coef = coef( estResult ), yName = "qOutput" )
elaObs
# same as
elaObs2 <- elas( estResult, yObs = TRUE )
all.equal( elaObs, elaObs2 )