Learn R Programming

micEcon (version 0.5-1)

cobbDouglasCalc: Calculate dependent variable of a Cobb-Douglas function

Description

Calculate the dependent variable of a Cobb-Douglas function.

Usage

cobbDouglasCalc( xNames, data, coef, 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 variab
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.

See Also

translogCalc, cobbDouglasOpt.

Examples

Run this code
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 )

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

Run the code above in your browser using DataLab