linearmodels.iv.model.IV2SLS¶
-
class linearmodels.iv.model.IV2SLS(dependent, exog, endog, instruments, *, weights=
None
)[source]¶ Estimation of IV models using two-stage least squares
- Parameters:¶
Notes
The 2SLS estimator is defined
\[\begin{split}\hat{\beta}_{2SLS} & =(X'Z(Z'Z)^{-1}Z'X)^{-1}X'Z(Z'Z)^{-1}Z'Y\\ & =(\hat{X}'\hat{X})^{-1}\hat{X}'Y\\ \hat{X} & =Z(Z'Z)^{-1}Z'X\end{split}\]The 2SLS estimator is a special case of a k-class estimator with \(\kappa=1\),
Todo
VCV: bootstrap
Methods
estimate_parameters
(x, y, z, kappa)Parameter estimation without error checking
fit
(*[, cov_type, debiased])Estimate model parameters
from_formula
(formula, data, *[, weights])- type formula:
predict
(params, *[, exog, endog, data, eval_env])Predict values for additional data
resids
(params)Compute model residuals
wresids
(params)Compute weighted model residuals
Properties
Formula used to create the model
Flag indicating the model includes a constant or equivalent
Locations of observations with missing values
Locations of observations included in estimation