kClassIVreg.fit | R Documentation |
kClassIVreg.fit
runs a generic linear IV model of the k-Class
kClassIVreg.fit(
Y,
X,
Z,
method = "JIVE",
vctype = "HC3",
cluster = NULL,
weights = NULL
)
Y |
outcome variable |
X |
matrix of covariates. |
Z |
matrix of instruments. Defaults to |
method |
method of the k-class to implement. Defaults to "JIVE". |
vctype |
type of sandwich covariance matrix (see vcovHC) |
cluster |
vector of length |
weights |
a vector of length |
Available methods in the k-Class include
The Jackknife IV of Angrist et al. 1999
Limited Maximum Likelihood
The Jackknife Limited Maximum Likelihood of Hausman et al. 2012
The heteroskedasticity robust version of the Fuller (1977) estimator
an IV regression object which also contains coefficients, standard errors, etc.
## Generate data and run MMD regression
n=200; set.seed(12); X = rnorm(n); er = rchisq(n,df=1)-1; Z=X
Z=cbind(Z,Z^2,Z^3,Z^4);X=scale(abs(X))+er/sqrt(2); Y=X+er
summary(kClassIVreg.fit(Y=Y,X=X,Z=Z))
summary(ivreg::ivreg(formula = Y ~ X | Z)) #compare to conventional IV regression
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.