statsmodels.genmod.generalized_linear_model.GLMResults.plot_added_variable¶
-
GLMResults.
plot_added_variable
(focus_exog, resid_type=None, use_glm_weights=True, fit_kwargs=None, ax=None)[source]¶ Create an added variable plot for a fitted regression model.
Parameters: focus_exog : int or string
The column index of exog, or a variable name, indicating the variable whose role in the regression is to be assessed.
resid_type : string
The type of residuals to use for the dependent variable. If None, uses resid_deviance for GLM/GEE and resid otherwise.
use_glm_weights : bool
Only used if the model is a GLM or GEE. If True, the residuals for the focus predictor are computed using WLS, with the weights obtained from the IRLS calculations for fitting the GLM. If False, unweighted regression is used.
fit_kwargs : dict, optional
Keyword arguments to be passed to fit when refitting the model.
ax : Axes instance
Matplotlib Axes instance
Returns: fig : matplotlib Figure
A matplotlib figure instance.