statsmodels.sandbox.regression.gmm.IV2SLS¶
-
class
statsmodels.sandbox.regression.gmm.
IV2SLS
(endog, exog, instrument=None)[source]¶ Class for instrumental variables estimation using Two-Stage Least-Squares
Parameters: endog: array 1d
endogenous variable
exog : array
explanatory variables
instruments : array
instruments for explanatory variables, needs to contain those exog variables that are not instrumented out
Notes
All variables in exog are instrumented in the calculations. If variables in exog are not supposed to be instrumented out, then these variables need also to be included in the instrument array.
Degrees of freedom in the calculation of the standard errors uses df_resid = (nobs - k_vars). (This corresponds to the small option in Stata’s ivreg2.)
Methods
fit
()estimate model using 2SLS IV regression initialize
()predict
(params[, exog])Return linear predicted values from a design matrix. whiten
(X)Attributes
endog_names
exog_names