quadFuncEst function

Estimate a quadratic function

Estimate a quadratic function

Estimate a quadratic function.

quadFuncEst( yName, xNames, data, shifterNames = NULL, linear = FALSE, homWeights = NULL, 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 pdata.frame).

  • 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).

  • 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 regScale and NOT divided by the square of regScale).

  • ...: further arguments are passed to lm

    or plm.

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 (PiP_i) in homWeights

(wi=dP/dPiw_i = d P / d P_i) is not really its weight (c("%", "\n\n", "(dP/dPi)(Pi/P) ( d P / d P_i ) ( P_i / P )")), in particular, if the numerical values of the variables (P1,,PnP_1, \ldots, P_n) are rather different.

Returns

a list of class quadFuncEst containing following objects: - est: the object returned by lm

or `plm`.
  • nExog: length of argument xNames.

  • nShifter: length of argument shifterNames.

  • residuals: residuals.

  • fitted: fitted values.

  • coef: vector of all coefficients.

  • coefCov: covariance matrix of all coefficients.

  • r2: R2R^2 value.

  • r2bar: adjusted R2R^2 value.

  • nObs: number of observations.

  • model.matrix: the model matrix.

  • call: the matched call.

  • yName: argument yName.

  • xNames: argument xNames.

  • shifterNames: argument shifterNames.

  • homWeights: argument homWeights.

  • regScale: argument regScale.

See Also

quadFuncCalc, quadFuncDeriv, translogEst and snqProfitEst.

Author(s)

Arne Henningsen

Examples

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