depictr.effects_plot#

depictr.effects_plot(model, var, conf_level=0.95, n=100, title=None)#

Predicted response as one predictor varies, with a confidence band.

The predictor var is swept across its observed range while every other numeric predictor is held at its mean and every categorical at its reference (most common) level. The line is the predicted response and the ribbon its confidence band, both read from statsmodels’ get_prediction.

Parameters:
  • model (statsmodels results object) – A fitted OLS/GLM result from a formula and a DataFrame (so the source data is retained for building the grid).

  • var (str) – The predictor to vary along the x-axis. Must be a numeric column.

  • conf_level (float) – Confidence level for the band.

  • n (int) – Number of points across the predictor’s range.

  • title (str, optional) – Plot title.

Return type:

plotnine.ggplot