cobbDouglasOpt: Optimal Values of Independent Variables of a Cobb-Douglas...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cobbDouglasOpt.R

Description

Calculate the optimal values of the variable independent variables of a Cobb-Douglas function.

Usage

1
2
cobbDouglasOpt( pyName, pxNames, data, coef,
   zNames = NULL, zCoef = NULL, xNames = NULL, dataLogged = FALSE  )

Arguments

pyName

character string containing the name of the price of the dependent variable.

pxNames

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

data

data frame containing the data.

coef

vector containing the intercept and the coefficients of the variable independent variables: 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 variable independent variables with corresponding prices defined in argument pxNames (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 variable independent variables with corresponding prices defined in argument xNames (numbered in that order).

zNames

optional vector of strings containing the names of the fixed independent variables.

zCoef

vector containing the coefficients of the fixed independent variables: if the elements of the vector have no names, they are taken as coefficients of the fixed independent variables defined in argument zNames (in the same order); if the elements of coef have names, the elements named d_1, ..., d_m are taken as coefficients of the fixed independent variables with corresponding prices defined in argument zNames (numbered in that order).

xNames

optional vector of strings containing the names that should be assigned to the returned variable independent variables.

dataLogged

logical. Are the prices and fixed independent variables in data with names defined in pyName, pxNames, and zNames already logged?

Value

A data frame containing the optimal values of the variable independent variables. If the prices and fixed independent variables are provided as logarithmic values (argument dataLogged is TRUE), the optimal values of the variable independent variables are returned as logarithms, too; non-logarithmic values are returned otherwise.

Author(s)

Arne Henningsen

See Also

cobbDouglasCalc.

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
   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( yName = "qOutput",
      xNames = c( "qLabor", "qVarInput", "land", "time" ),
      data = germanFarms, linear = TRUE )

   # calculate optimal quantities of variable inputs
   xCoef <- coef( estResult )[ 1:3 ]
   zCoef <- coef( estResult )[ 4:5 ]
   names( zCoef ) <- c( "d_1", "d_2" )
   optInput <- cobbDouglasOpt( pyName = "pOutput",
      pxNames = c( "pLabor", "pVarInput" ), coef = xCoef,
      data = germanFarms, xNames = c( "qLabor", "qVarInput" ),
      zNames = c( "land", "time" ), zCoef = zCoef )

   # compare observed with optimal input quantities
   plot( germanFarms$qLabor, optInput$qLabor )
   plot( germanFarms$qVarInput, optInput$qVarInput )

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/

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