quadFuncEla: Elasticities of a Quadratic Function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/quadFuncEla.R

Description

Calculate elasticities of a quadratic function.

Usage

1
2
3
4
5
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 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).

object

object of class quadFuncEst (returned by quadFuncEst).

yObs

logical. Use observed values of the endogenous variable. If FALSE (default) predicted values calculated by quadFuncCalc are used.

...

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
   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 )

Example output

If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site:
https://r-forge.r-project.org/projects/micecon/
       qLabor     land   qVarInput        time
1   3.9067199 1.754268 -0.51994951  0.03346678
2   3.2101042 1.347122 -0.67383871  0.09277184
3   3.1628435 1.312384 -0.43158645  0.10914261
4   1.9607325 1.152726 -0.51310537  0.15377497
5   1.7554617 1.272660 -0.18551097  0.11707196
6   1.7008788 1.211832  0.01631034  0.11159376
7   1.8252482 1.023389  0.14243345  0.13672919
8   1.2774167 1.467527  0.36915183 -0.04441456
9   1.1479794 1.738357  0.88298712 -0.20210425
10  0.4552941 1.875422  0.75426155 -0.29645592
11  0.2583648 1.608280  0.73943539 -0.24471509
12 -1.5414041 1.604219 -0.30782745 -0.08274988
13 -1.6891202 1.367121 -0.47752535  0.01468336
14 -1.0733282 1.204391 -0.30435860 -0.02493184
15 -0.8541443 1.718699  0.31150456 -0.43420691
16 -0.3474438 1.764262  0.63103646 -0.61212251
17 -0.1026238 1.919868  0.58872974 -0.78037129
18  0.1076974 1.880339  0.54283928 -0.84195754
19  0.3140019 1.519889  0.30738974 -0.68231804
20  0.4273530 1.146063  0.08885107 -0.50610786
[1] TRUE
       qLabor     land   qVarInput        time
1   3.8760330 1.740488 -0.51586536  0.03320391
2   3.3413608 1.402204 -0.70139101  0.09656515
3   3.0988157 1.285816 -0.42284952  0.10693316
4   1.9064063 1.120788 -0.49888872  0.14951432
5   1.7566771 1.273542 -0.18563941  0.11715302
6   1.7319343 1.233958  0.01660814  0.11363129
7   1.8261903 1.023918  0.14250697  0.13679976
8   1.2816212 1.472357  0.37036688 -0.04456075
9   1.1356496 1.719687  0.87350346 -0.19993357
10  0.4580817 1.886904  0.75887970 -0.29827104
11  0.2589093 1.611669  0.74099378 -0.24523083
12 -1.5384147 1.601108 -0.30723044 -0.08258939
13 -1.6958230 1.372546 -0.47942030  0.01474163
14 -1.0727819 1.203778 -0.30420369 -0.02491915
15 -0.8500199 1.710400  0.31000042 -0.43211028
16 -0.3459359 1.756605  0.62829778 -0.60946592
17 -0.1039031 1.943799  0.59606836 -0.79009876
18  0.1068557 1.865641  0.53859635 -0.83537665
19  0.3145121 1.522358  0.30788917 -0.68342663
20  0.4272972 1.145913  0.08883948 -0.50604185
[1] TRUE

micEcon documentation built on Jan. 7, 2021, 3:01 p.m.

Related to quadFuncEla in micEcon...