ExperimentResult.to_lift_test#
- ExperimentResult.to_lift_test(channel, x, delta_x, **dim_kwargs)[source]#
Convert experiment results to a lift test DataFrame.
Produces a single-row DataFrame in the format expected by
MMM.add_lift_test_measurements(), with columnschannel,x,delta_x,delta_y,sigma, plus any additional dimension columns.- Parameters:
- channel
str The marketing channel name. Must match one of the MMM’s
channel_columns.- x
float The baseline spend level for the channel during the experiment period.
- delta_x
float The change in spend during the experiment.
- **dim_kwargs
str Additional dimension values, e.g.
geo="US". Keys must match the MMM’sdims.
- channel
- Returns:
pd.DataFrameA single-row DataFrame with columns:
channel,x,delta_x,delta_y,sigma, and any dimension columns fromdim_kwargs.
Examples
df_lift = result.to_lift_test( channel="tv", x=1000.0, delta_x=200.0, geo="US", )