statsmodels.stats.outliers_influence.OLSInfluence¶

class
statsmodels.stats.outliers_influence.
OLSInfluence
(results)[source]¶ class to calculate outlier and influence measures for OLS result
 Parameters
 resultsRegressionResults
currently assumes the results are from an OLS regression
Notes
One part of the results can be calculated without any auxiliary regression (some of which have the _internal postfix in the name. Other statistics require leaveoneobservationout (LOOO) auxiliary regression, and will be slower (mainly results with _external postfix in the name). The auxiliary LOOO regression only the required results are stored.
Using the LOO measures is currently only recommended if the data set is not too large. One possible approach for LOOO measures would be to identify possible problem observations with the _internal measures, and then run the leaveoneobservationout only with observations that are possible outliers. (However, this is not yet available in an automized way.)
This should be extended to general least squares.
The leaveonevariableout (LOVO) auxiliary regression are currently not used.
 Attributes
det_cov_params_not_obsi
determinant of cov_params of all LOOO regressions
params_not_obsi
parameter estimates for all LOOO regressions
Methods
Cooks distance
covariance ratio between LOOO and original
dfbeta
()dfbetas
dfbetas
()uses results from leaveoneobservationout loop
dffits
()dffits measure for influence of an observation
dffits measure for influence of an observation
Error sum of squares of PRESS residuals
get_resid_studentized_external
([sigma])calculate studentized residuals
Factor of diagonal of hat_matrix used in influence
Diagonal of the hat_matrix for OLS
Influence measure
plot_index
([y_var, threshold, title, ax, idx])index plot for influence attributes
plot_influence
([external, alpha, criterion, …])Plot of influence in regression.
PRESS residuals
estimate of standard deviation of the residuals
Studentized residuals using variance from OLS
Studentized residuals using LOOO variance
Studentized residuals using variance from OLS
estimate of variance of the residuals
error variance for all LOOO regressions
Creates a DataFrame with all available influence results.
summary_table
([float_fmt])create a summary table with all influence and outlier measures