This function estimates the model parameters and associated standard errors for a
linear regression model with one or more endogenous regressors. Identification is achieved
through heteroscedastic covariance restrictions within the triangular system as proposed in Lewbel(2012). The function hetErrorsIV
builds on the lewbel
function form the ivlewbel
package. Changes have been made only to the printing and the summary of
the function, as well as the name.
hetErrorsIV(formula, data, clustervar = NULL, robust = TRUE)
the model formula, e.g.y ~ X1 + X2 + P
.
the data frame containing the dataset. This argument is mandatory.
a character value naming the cluster on which to adjust the standard errors and test statistics.
if TRUE the function reports standard errors and test statistics that have been corrected for the presence heteroscedasticity using White's method.
Returns an object of class hetREndo
, with the following components:
a coefficient matrix with columns containing the estimates, associated standard errors, test statistics and p-values..
the matched call.
the number of observations.
J-test for overidentifying restrictions.
Partial F-test statistics for weak IV detection.
The formula follows a four-part specification. The following formula is an example: y2 ~ y1 | x1 + x2 + x3 | x1 + x2 | z1. Here, y2 is the dependent variable and y1 is the endogenous regressor. The code x1 + x2 + x3 represents the exogenous regressors whereas the third part x1 + x2 specifies the exogenous heteroscedastic variables from which the instruments are derived. The final part z1 is optional, allowing the user to include tradtional instrumental variables. If both robust=TRUE and clustervar=TRUE, the function overrides the robust command and computes clustered standard errors and test statistics adjusted to account for clustering. The function also computes partial F-statistics that indicate potentially weak identification. In cases where there is more than one endogenous regressor the Angrist-Pischke (2009) method for multivariate first-stage F-statistics is employed.
Lewbel, A. (2012). Using Heteroskedasticity to Identify and Estimate Mismeasured and Endogenous Regressor Models,Journal of Business \& Economic Statistics, 30(1), 67-80.
Angrist, J. and Pischke, J.S. (2009). Mostly Harmless Econometrics: An Empiricists Companion, Princeton University Press.
Fernihough, A. (2014). ivlewbel package: Uses heteroscedasticity to estimate mismeasured and endogenous regressor models.
# NOT RUN {
data(dataHetIV)
resultsHetIV <- hetErrorsIV(y ~ P| X1 + X2 | X1 + X2, data = dataHetIV)
summary(resultsHetIV)
# }
Run the code above in your browser using DataLab