A dataset with two exogenous regressors,
X1,X2, and one endogenous, continuous regressor P.
An intercept and a dependent variable, y, are also included.
The true parameter values for the coefficients are: b0 = 2, b1 = 1.5,
b2 = 3 and the coefficient of the endogenous regressor, P, is equal to a1 = -1.
data("dataHigherMoments")A data frame with 2500 observations on 4 variables:
ya numeric vector representing the dependent variable.
X1a numeric vector, normally distributed and exogenous.
X2a numeric vector, normally distributed and exogenous.
Pa numeric vector, continuous and endogenous regressor, normally distributed.
data("dataHigherMoments")
# to recover the parameters,
# on average over many simulations
higherMomentsIV(formula = y ~ X1 + X2 + P|P|IIV(iiv=yp),
data=dataHigherMoments)
#> The following internal instruments were built: IIV(iiv=yp).
#> Fitting an instrumental variable regression with model y ~ X1 + X2 + P|X1 + X2 + IIV(iiv=yp).
#>
#> Call:
#> higherMomentsIV(formula = y ~ X1 + X2 + P | P | IIV(iiv = yp), data = dataHigherMoments)
#>
#> Coefficients:
#> (Intercept) X1 X2 P
#> 1.619 1.586 3.062 -1.014
#>