quadFuncEla {micEcon} | R Documentation |
Calculate elasticities of a quadratic function.
quadFuncEla( xNames, data, coef, yName = NULL, shifterNames = NULL, homWeights = NULL, quadHalf = TRUE ) ## S3 method for class 'quadFuncEst': elas( object, data = NULL, yObs = FALSE, ... )
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 data of elas.quadFuncEst is not specified,
the data frame that was used for the estimation
is used for calculating elasticities. |
coef |
vector containing all coefficients. |
yName |
an optional string containing the name of the dependent
variable.
If it is NULL , the dependent variable is calculated
from the independent variables and the coefficients. |
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 quadFuncEst ). |
quadHalf |
logical. Multiply the quadratic terms by one half? |
object |
object of class quadFuncEst
(returned by quadFuncEst ). |
yObs |
logical. Use observed values of the andogenous variable.
If FALSE (default) predicted values calculated by
quadFuncCalc are used. |
... |
currently ignored. |
A data.frame of class quadFuncEla
,
where each column corresponds to one of the independent variables.
Arne Henningsen
quadFuncEst
, quadFuncDeriv
, and
quadFuncCalc
.
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 )