View source: R/f_highermomentsIV.R
higherMomentsIV | R Documentation |
Fits linear models with one endogenous regressor using internal instruments built using the approach described in Lewbel A. (1997). This is a statistical technique to address the endogeneity problem where no external instrumental variables are needed. The implementation allows the incorporation of external instruments if available. An important assumption for identification is that the endogenous variable has a skewed distribution.
higherMomentsIV(formula, data, verbose = TRUE)
formula |
A symbolic description of the model to be fitted. See the "Details" section for the exact notation. |
data |
A data.frame containing the data of all parts specified in the formula parameter. |
verbose |
Show details about the running of the function. |
Consider the model:
The observed data consist of Y_{t}, X_{t} and P_{t}, while Z_{t}, ε_{t}, and ν_{t} are unobserved. The endogeneity problem arises from the correlation of P_{t} with the structural error ε_{t}, since E(εν)≠0. The requirement for the structural and measurement error is to have mean zero, but no restriction is imposed on their distribution.
Let S̅ be the sample mean of a variable S_{t}
and G_{t}=G(X_{t}) for any given function G
that
has finite third own and cross moments. Lewbel(1997) proves that the following instruments can be constructed and used with two-stage least squares to obtain consistent estimates:
Instruments in equations 3e
and 3f
can be used only when the measurement and the structural errors are symmetrically distributed.
Otherwise, the use of the instruments does not require any distributional assumptions for the errors. Given that the regressors G(X) = X
are included as instruments, G(X)
should not be linear in X
in equation 3a
.
Let small letter denote deviation from the sample mean: s_{i} = S_{i}-S̅.
Then, using as instruments the variables presented in equations 3
together with 1
and
X_{t}, the two-stage-least-squares estimation will provide consistent estimates for the parameters
in equation 1
under the assumptions exposed in Lewbel(1997).
The formula
argument follows a four part notation:
A two-sided formula describing the model (e.g. y ~ X1 + X2 + P
), a single endogenous regressor
(e.g. P
), and the exogenous variables from which the internal instrumental variables should
be build (e.g. IIV(iiv=y2)
), each part separated by a single vertical bar (|
).
The instrumental variables that should be built are specified as (multiple) functions, one for each
instrument. This function is IIV
and uses the following arguments:
iiv
Which internal instrument to build. One of g, gp, gy, yp, p2, y2
can be chosen.
g
Which function g
represents in iiv
.
One of x2, x3, lnx, 1/x
can be chosen.
Only required if the type of internal instrument demands it.
...
The exogenous regressors to build the internal instrument. If more than one is given, separate instruments are built for each. Only required if the type of internal instrument demands it.
Note that no argument to IIV
is to be supplied as character but as symbols without quotation marks.
Optionally, additional external instrumental variables to also include in the instrumental variable regression can be specified. These external instruments have to be already present in the data and are provided as the fourth right-hand side part of the formula, again separated by a vertical bar.
See the example section for illustrations on how to specify the formula
parameter.
Returns an object of classes rendo.ivreg
and ivreg
, It extends the object returned from
function ivreg
of package AER
and slightly modifies it by adapting the call
and formula
components. The summary
function prints additional diagnostic information as
described in documentation for summary.ivreg
.
All generic accessor functions for ivreg
such as anova
, hatvalues
, or vcov
are available.
Lewbel A (1997). “Constructing Instruments for Regressions with Measurement Error When No Additional Data are Available, With an Application to Patents and R&D.” Econometrica, 65(5), 1201–1213.
ivreg
data("dataHigherMoments")
# P is the endogenous regressor in all examples
# 2 IVs with g*p, g=x^2, separately for each regressor X1 and X2.
hm <- higherMomentsIV(y~X1+X2+P|P|IIV(iiv=gp, g=x2, X1, X2),
data = dataHigherMoments)
# same as above
hm <- higherMomentsIV(y~X1+X2+P|P|IIV(iiv=gp, g=x2, X1) +
IIV(iiv=gp, g=x2, X2),
data = dataHigherMoments)
# 3 different IVs
hm <- higherMomentsIV(y~X1+X2+P|P|IIV(iiv=y2) + IIV(iiv=yp) +
IIV(iiv=g,g=x3,X1),
data = dataHigherMoments)
# use X2 as external IV
hm <- higherMomentsIV(y~X1+P|P|IIV(iiv=y2)+IIV(iiv=g,g=lnx,X1)| X2,
data = dataHigherMoments)
summary(hm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.