cobbDouglasCalc: Calculate dependent variable of a Cobb-Douglas function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cobbDouglasCalc.R

Description

Calculate the dependent variable of a Cobb-Douglas function.

Usage

1
cobbDouglasCalc( xNames, data, coef, coefCov = 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).

dataLogged

logical. Are the values in data already logged?

Value

A vector containing the endogenous variable. If the inputs are provided as logarithmic values (argument dataLogged is TRUE), the endogenous variable is returned as logarithm; non-logarithmic values are returned otherwise.

If argument coefCov is specified, the returned vector has an attribute "variance" that is a vector containing the variances of the calculated (fitted) endogenous variable.

Author(s)

Arne Henningsen

See Also

translogCalc, cobbDouglasOpt.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
   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", "land", "qVarInput", "time" ),
      germanFarms, linear = TRUE )

   # fitted values
   fitted <- cobbDouglasCalc( c( "qLabor", "land", "qVarInput", "time" ), germanFarms,
      coef( estResult )[ 1:5 ] )
   #equal to estResult$fitted

   # fitted values and their variances
   fitted2 <- cobbDouglasCalc( c( "qLabor", "land", "qVarInput", "time" ), germanFarms,
      coef( estResult )[ 1:5 ], coefCov = vcov( estResult )[ 1:5, 1:5 ] )
   # t-values
   c( fitted2 ) / attributes( fitted2 )$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/
        1         2         3         4         5         6         7         8 
 50.48083  82.49472 103.01522 107.81870 127.34444 105.28301  68.01886 112.07633 
        9        10        11        12        13        14        15        16 
 84.21162  78.72629 107.84903  70.28020  66.40642  75.79816 109.44954 129.60836 
       17        18        19        20 
 86.77739  78.85693  76.88182  56.77147 

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