cobbDouglasDeriv: Derivatives of a Cobb-Douglas function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cobbDouglasDeriv.R

Description

Calculate the derivatives of a Cobb-Douglas function.

Usage

1
2
cobbDouglasDeriv( xNames, data, coef, coefCov = NULL,
   yName = NULL, dataLogged = FALSE )

Arguments

xNames

a vector of strings containing the names of the independent variables.

data

data frame containing the data.

coef

vector containing the coefficients: if the elements of the vector have no names, the first element is taken as intercept of the logged equation and the following elements are taken as coefficients of the independent variables defined in argument xNames (in the same order); if the elements of coef have names, the element named a_0 is taken as intercept of the logged equation and the elements named a_1, ..., a_n are taken as coefficients of the independent variables defined in argument xNames (numbered in that order).

coefCov

optional covariance matrix of the coefficients (the order of the rows and columns must correspond to the order of the coefficients in argument coef).

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.

dataLogged

logical. Are the values in data already logged?

Value

a list of class cobbDouglasDeriv containing following objects:

deriv

data frame containing the derivatives.

variance

data frame containing the variances of the derivatives (only if argument coefCov is provided). NOTE: if argument yName is specified, the variance of the endogenous variable is currently ignored.

Author(s)

Arne Henningsen

See Also

cobbDouglasCalc, translogDeriv.

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
   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 Cobb-Douglas production function
   estResult <- translogEst( "qOutput", c( "qLabor", "qVarInput", "land", "time" ),
      germanFarms, linear = TRUE )

   # compute the marginal products of the inputs (with "fitted" Output)
   margProducts <- cobbDouglasDeriv( c( "qLabor", "qVarInput", "land", "time" ),
      data = germanFarms, coef = coef( estResult )[1:5],
      coefCov = vcov( estResult )[1:5,1:5] )
   margProducts$deriv
   # t-values
   margProducts$deriv / margProducts$variance^0.5

   # compute the marginal products of the inputs (with observed Output)
   margProductsObs <- cobbDouglasDeriv( c( "qLabor", "qVarInput", "land", "time" ),
      data = germanFarms, coef = coef( estResult )[1:5], yName = "qOutput",
      coefCov = vcov( estResult )[1:5,1:5] )
   margProductsObs$deriv
   # t-values
   margProductsObs$deriv / margProductsObs$variance^0.5

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 qVarInput     land      time
1   99.0894 0.3970801 30.35450 84.041473
2  110.0180 0.4072783 32.81447 46.979189
3  116.7158 0.4281926 33.88599 32.997024
4  120.0013 0.4206170 35.49141 26.151207
5  122.1964 0.4324995 36.14061 21.303647
6  126.6521 0.4388961 36.73344 18.276047
7  133.4532 0.4450165 37.17738 16.281818
8  131.0383 0.4667286 37.42500 14.374691
9  129.6781 0.4644663 37.94215 12.560007
10 131.2093 0.4794587 38.33225 11.823880
11 136.7810 0.4749881 38.91511 11.205433
12 141.6943 0.4873770 39.90736 11.753351
13 148.4174 0.4876964 40.37226 11.431267
14 155.5988 0.5044476 40.18381 10.931978
15 152.6791 0.5294154 39.78565  9.891818
16 157.2361 0.5454771 39.52838  9.318844
17 162.6014 0.5822371 39.09538  9.126291
18 169.2361 0.6050482 38.92650  8.970972
19 180.2626 0.6185030 38.96230  9.052550
20 191.2731 0.6231196 39.15906  9.125212
      qLabor qVarInput      land     time
1  0.5965784  1.480373  9.711440 6.593936
2  0.5994816  1.462595 10.017006 6.503329
3  0.6002082  1.464959 10.095614 6.300091
4  0.6006107  1.454141 10.459723 6.334165
5  0.6000763  1.460793 10.660538 6.177060
6  0.6013456  1.455636 10.575516 6.136926
7  0.6038850  1.443687 10.215687 6.156442
8  0.5996511  1.469694 10.751352 5.969378
9  0.5993496  1.473437 11.024094 5.844547
10 0.5971295  1.483157 11.219905 5.832680
11 0.5994777  1.466048 11.021208 5.952075
12 0.5958972  1.466307 11.200564 6.228804
13 0.5978652  1.451263 10.871302 6.386986
14 0.5996857  1.446771 10.449325 6.404993
15 0.5972679  1.471159 10.689122 6.121172
16 0.5986039  1.471263 10.391831 6.059462
17 0.5974987  1.483187 10.104983 6.006856
18 0.5980166  1.482929  9.814264 6.032193
19 0.6003805  1.468176  9.408167 6.196618
20 0.6031225  1.450009  9.031480 6.382436
     qLabor qVarInput     land      time
1  102.3570 0.4101741 31.35547 86.812810
2  103.4343 0.3829060 30.85079 44.167859
3  115.7119 0.4245098 33.59454 32.713221
4  123.3440 0.4323335 36.48005 26.879663
5  124.0092 0.4389159 36.67678 21.619701
6  125.6682 0.4354867 36.44809 18.134078
7  133.1547 0.4440210 37.09422 16.245396
8  134.7244 0.4798577 38.47777 14.779052
9  127.1239 0.4553179 37.19482 12.312618
10 130.1685 0.4756555 38.02818 11.730088
11 138.5365 0.4810843 39.41456 11.349247
12 142.0309 0.4885348 40.00216 11.781271
13 144.3341 0.4742786 39.26151 11.116764
14 158.2073 0.5129043 40.85746 11.115245
15 155.2843 0.5384490 40.46453 10.060607
16 157.3369 0.5458269 39.55373  9.324821
17 159.1553 0.5698974 38.26681  8.932873
18 168.8255 0.6035804 38.83207  8.949209
19 181.5019 0.6227554 39.23018  9.114789
20 191.5486 0.6240168 39.21545  9.138351
      qLabor qVarInput     land    time
1  0.5993132  1.465376 10.42118 6.18885
2  0.5993132  1.465376 10.42118 6.18885
3  0.5993132  1.465376 10.42118 6.18885
4  0.5993132  1.465376 10.42118 6.18885
5  0.5993132  1.465376 10.42118 6.18885
6  0.5993132  1.465376 10.42118 6.18885
7  0.5993132  1.465376 10.42118 6.18885
8  0.5993132  1.465376 10.42118 6.18885
9  0.5993132  1.465376 10.42118 6.18885
10 0.5993132  1.465376 10.42118 6.18885
11 0.5993132  1.465376 10.42118 6.18885
12 0.5993132  1.465376 10.42118 6.18885
13 0.5993132  1.465376 10.42118 6.18885
14 0.5993132  1.465376 10.42118 6.18885
15 0.5993132  1.465376 10.42118 6.18885
16 0.5993132  1.465376 10.42118 6.18885
17 0.5993132  1.465376 10.42118 6.18885
18 0.5993132  1.465376 10.42118 6.18885
19 0.5993132  1.465376 10.42118 6.18885
20 0.5993132  1.465376 10.42118 6.18885

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