quadFuncEla | R Documentation |
Calculate elasticities of a quadratic function.
quadFuncEla( xNames, data, coef, yName = NULL, shifterNames = NULL, homWeights = NULL ) ## 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 |
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. |
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.