Learn R Programming

micEcon (version 0.5-22)

npregHom: Nonparametric Regression with Homogeneity Imposed

Description

Nonparametric regression with homogeneity of degree zero in some regressors imposed.

Usage

npregHom( yName, xNames, homWeights, data, restrictGrad = TRUE,
   bws = NULL, ...)

Arguments

yName
a character string containing the name of the dependent variable.
xNames
a vector of strings containing the names of the independent 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).
data
data frame containing the data.
restrictGrad
logical value indicating whether the sum of the gradients of all normalized variables should be restricted to be zero? (see details).
bws
bandwidths (see npreg).
...
further arguments are passed to npreg.

Value

  • a list of class npregHom containing following objects:
  • estthe object returned by npreg.
  • gradmatrix containing the gradients of all regressors.
  • callthe matched call.
  • yNameargument yName.
  • xNamesargument xcNames.
  • homWeightsargument homWeights.
  • restrictGradargument restrictGrad.

Details

Argument homWeights is used to impose homogeneity of degree zero in some (continuous) independent 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.

The variables that are normalized with the weighted index of theses variables are linearly dependent. Hence, a model that includes these variables cannot be estimated by standard econometric methods such as OLS. To allow the estimation of this model by standard econometric methods, the sum of the gradients (=coefficients) of the normalized variables is generally restricted to zero. If argument restrictGrad is TRUE, this is done also by npregHom. In contrast to OLS results that do not depend on which variable is eliminated by the restriction, the results of npregHom depend on which variable is eliminated by the restriction. The variable that corresponds to the first weight in argument homWeights is eliminated in npregHom.

See Also

elas.npregHom, quadFuncEst, npreg, and npregbw.

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)

   # weights to impose
   weights <- c(
      pOutput = mean( germanFarms$qOutput ),
      pVarInput = mean( germanFarms$qVarInput ),
      pLabor = mean( germanFarms$qLabor ) )
   weights <- weights / sum( weights )

   # estimate an input demand function
   estResult <- npregHom( "qVarInput",
      xNames = c( "pOutput", "pVarInput", "pLabor", "land" ),
      data = germanFarms, homWeights = weights )
   estResult$grad

   # estimate an input demand function using the Epanechnikov kernel
   estResultEpa <- npregHom( "qVarInput",
      xNames = c( "pOutput", "pVarInput", "pLabor", "land" ),
      data = germanFarms, homWeights = weights, ckertype="epanechnikov" )
   estResultEpa$grad

   # estimate an input demand function with manual bandwidths selection
   estResultMan <- npregHom( "qVarInput",
      xNames = c( "pOutput", "pVarInput", "pLabor", "land" ),
      data = germanFarms, homWeights = weights, bws = rep( 1, 3 ),
      bwscaling = TRUE )
   estResultMan$grad

Run the code above in your browser using DataLab