Learn R Programming

micEcon (version 0.6-0)

quadFuncEst: Estimate a quadratic function

Description

Estimate a quadratic function.

Usage

quadFuncEst( yName, xNames, data, shifterNames = NULL,
   linear = FALSE, homWeights = NULL, quadHalf = TRUE, 
   regScale = 1, ...)

Arguments

yName
a character string containing the name of the dependent variable.
xNames
a vector of strings containing the names of the independent variables.
data
data frame containing the data (possibly a panel data frame created with plm.data).
shifterNames
a vector of strings containing the names of the independent variables that should be included as shifters only (not in quadratic or interaction terms).
linear
logical. Restrict the coefficients of all quadratic and interaction terms to be zero so that the estimated function is linear in the exogenous variables?
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 details).
quadHalf
logical. Multiply the quadratic terms by one half?
regScale
a scalar or vector with length equal to nrow( data ). All regressors except for shifter variables that are logical or factors are divided by regScale (NOTE: quadratic and interaction terms are also divided by
...
further arguments are passed to lm or plm.

Value

  • a list of class quadFuncEst containing following objects:
  • estthe object returned by lm or plm.
  • nExoglength of argument xNames.
  • nShifterlength of argument shifterNames.
  • residualsresiduals.
  • fittedfitted values.
  • coefvector of all coefficients.
  • coefCovcovariance matrix of all coefficients.
  • r2$R^2$ value.
  • r2baradjusted $R^2$ value.
  • nObsnumber of observations.
  • model.matrixthe model matrix.
  • callthe matched call.
  • yNameargument yName.
  • xNamesargument xNames.
  • shifterNamesargument shifterNames.
  • homWeightsargument homWeights.
  • quadHalfargument quadHalf.
  • regScaleargument regScale.

Details

If argument homWeights is used to impose homogeneity of degree zero in some variables, the weighting factors in this vector must have names that are equal to the variable names in argument xNames. The order of the elements in homWeights is arbitrary and may or may not be equal to the order of the elements in xNames. Argument homWeights may contain less elements than xNames; in this case, homogeneity of degree zero is imposed only on variables with names in homWeights. Please note that the weighting factor of a variable ($P_i$) in homWeights ($w_i = \partial P / \partial P_i$) is not really its weight ($( \partial P / \partial P_i ) ( P_i / P )$), in particular, if the numerical values of the variables ($P_1, \ldots, P_n$) are rather different.

See Also

quadFuncCalc, quadFuncDeriv, translogEst and snqProfitEst.

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 quadratic production function
   estResult <- quadFuncEst( "qOutput", c( "qLabor", "land", "qVarInput", "time" ),
      germanFarms )

   coef( estResult )
   estResult$r2

Run the code above in your browser using DataLab