Learn R Programming

REndo (version 1.2)

internalIV: Constructs Internal Instrumental Variables From Data

Description

The function can be used to construct additional instruments to be supplied to higherMomentsIV as additional instruments in the "EIV" argument.

Usage

internalIV(y, X, P, G = NULL, IIV = c("g", "gp", "gy", "yp", "p2", "y2"),
  data = NULL)

Arguments

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, x2, x3,lnx or 1/x. The last two forms are conditional on the values of the exogenous variables: greater than 0 or different from 0 respectively.
IIV
the internal instrumental variable to be constructed. It can take six values, "g","gp","gy","yp","p2"or"y2". See the "Details" section of higherMomentsIV for a description of the internal instruments.
data
optional data frame or list containing the variables in the model.

Value

Returns a vector/matrix constructed from the data whcih can be used as instrumental variable either in higherMomentsIV or in any other function/algorithm making use of instruments.

References

Lewbel, A. (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."

See Also

higherMomentsIV

Examples

Run this code
# load data
data(dataHigherMoments)
y <- dataHigherMoments[,1]
X <- cbind(dataHigherMoments[,2],dataHigherMoments[,3])
colnames(X) <- c("X1","X2")
P <- dataHigherMoments[,4]
# build an instrument gp = (G - mean(G))(P - mean(P))  using the internalIV() function 
# with G = "x3" meaning G(X) = X^3
eiv <- internalIV(y,X,P, G ="x3", IIV = "gp")

Run the code above in your browser using DataLab