Learn R Programming

grizbayr (version 1.3.5)

estimate_lift: Estimate Lift Distribution

Description

Estimates lift distribution vector from posterior samples.

Usage

estimate_lift(posterior_samples, distribution, wrt_option, metric = "lift")

Value

numeric, the lift distribution

Arguments

posterior_samples

Tibble returned from sample_from_posterior with 3 columns `option_name`, `samples`, and `sample_id`.

distribution

String of the distribution name

wrt_option

string the option lift is calculated with respect to (wrt). Required.

metric

string the type of lift. `absolute`` will be the difference, on the outcome scale. 0 when best = wrt_option `lift`` will be the (best - wrt_option) / wrt_option, 0 when best = wrt_option `relative_risk`` will be the ratio best/wrt_option, 1 when best = wrt_option

Examples

Run this code
# Requires posterior_samples dataframe. See `sample_from_posterior()`
# for an example.

if (FALSE) {
estimate_lift(posterior_samples = posterior_samples,
              distribution = "conversion_rate",
              wrt_option = "A",
              metric = "lift")
}

Run the code above in your browser using DataLab