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 columns channel, x, delta_x, delta_y, sigma, plus any additional dimension columns.

Parameters:
channelstr

The marketing channel name. Must match one of the MMM’s channel_columns.

xfloat

The baseline spend level for the channel during the experiment period.

delta_xfloat

The change in spend during the experiment.

**dim_kwargsstr

Additional dimension values, e.g. geo="US". Keys must match the MMM’s dims.

Returns:
pd.DataFrame

A single-row DataFrame with columns: channel, x, delta_x, delta_y, sigma, and any dimension columns from dim_kwargs.

Examples

df_lift = result.to_lift_test(
    channel="tv",
    x=1000.0,
    delta_x=200.0,
    geo="US",
)