Description Usage Arguments Details Value Author(s) References See Also Examples
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.
1 2 |
y |
the vector or matrix containing the dependent variable. |
X |
the data frame or matrix containing the exogenous regressors of the model. |
P |
the endogenous variables of the model as columns of a matrix or dataframe. |
G |
the functional form of G. It can take four values, |
IIV |
stands for "internal instrumental variable". It can take six values: |
EIV |
stands for "external instrumental variable". It is an optional argument that lets the user specify any external variable(s) to be used as instrument(s). |
data |
optional data frame or list containing the variables in the model. |
Consider the model below:
Y_t = b0 + gamma' * X_t + alpha * P_t + eps_t
P_t = Z + nu_t
The observed data consist of Y, X and P_t, while Z_t, eps_t, and nu_t are unobserved. The endogeneity problem arises from the correlation of P with the structural error, eps_t, since E(eps * nu) > 0. The requirement for the structural and measurement error is to have mean zero, but no restriction is imposed on their distribution.
Let mean(S) be the sample mean of a variable S_t and G = G(X) 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 2SLS to obtain consistent estimates:
q1 = G_t - mean(G)
q2 = (G_t - mean(G))(P_t -mean(P))
q3 = (G_t - mean(G))(Y_t - mean(Y))
q4 = (Y_t - mean(Y))(P_t - mean(P))
q5 = (P_t - mean(P))^2
q6 = (Y_t - mean(Y))^2
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 - mean(S). Then, using as instruments the variables presented in
equations 3
together with 1
and X, the two-stage-least-squares estimation will provide consistent estimates for the parameters
in equation 1
under the assumptions exposed in Lewbel(1997).
Returns an object of class ivreg
, with the following components:
coefficients |
parameters estimates. |
residulas |
a vector of residuals. |
fitted.values |
a vector of predicted means. |
n |
number of observations. |
df.residual |
residual degrees of freedom for the fitted model. |
cov.unscaled |
unscaled covariance matrix for coefficients. |
sigma |
residual standard error. |
call |
the original function call. |
formula |
the model formula. |
terms |
a list with elements "regressors" and "instruments" containing the terms objects for the respective components. |
levels |
levels of the categorical regressors. |
contrasts |
the contrasts used foe categorical regressors. |
x |
a list with elements "regressors", "instruments", "projected", containing the model matrices from the respective components. "projected" is the matrix of regressors projected on the image of the instruments. |
The implementation of the model formula by Raluca Gui based on the paper of Lewbel (1997).
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #load data
data(dataHMLewbel)
y <- dataHMLewbel$y
X <- cbind(dataHMLewbel$X1,dataHMLewbel$X2)
colnames(X) <- c("X1","X2")
P <- dataHMLewbel$P
# call hmlewbel with internal instrument yp = (Y - mean(Y))(P - mean(P))
hmlewbel(y,X,P, G = "x2", IIV = "yp")
# build an additional instrument p2 = (P - mean(P))^2 using the internalIV() function
eiv <- internalIV(y,X,P, G="x2", IIV = "p2")
# use the additional variable as external instrument in hmlewbel()
h <- hmlewbel(y,X,P,G = "x2",IIV = "yp", EIV=eiv)
h$coefficients
# get the robust standard errors using robust.se() function from package ivpack
# library(ivpack)
# sder <- robust.se(h)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.