geostep.visualizer.plot_did_results

geostep.visualizer.plot_did_results(results: Dict[str, Any], df: DataFrame, date_col: str, kpi_col: str, assignment_col: str, test_period_start: str, save_path: str | None = None) None

Plots the time series trends for Treatment and Control groups.

Parameters:
  • results (dict) – The results of the DID analysis.

  • df (pd.DataFrame) – The DataFrame containing the full experimental data.

  • assignment_col (str) – Names of the relevant columns.

  • date_col (str) – Names of the relevant columns.

  • kpi_col (str) – Names of the relevant columns.

  • test_period_start (str) – The start date of the test period (YYYY-MM-DD), used to draw a vertical line.

  • save_path (str, optional) – If provided, saves the plot to this path. Otherwise, displays the plot.