For each subset, calculate the difference in Beta distributions across two groups, and label it as significant if we can confidently claim that the HDI of the difference is other than zero. Do not attempt tests in subsets for which we do not have a good estimate of the success rate to start with (HDI range = 1).

compare_hdi(happy_hdi, sample_size = 1e+05, significance = 0.05)

Arguments

happy_hdi

A happy_hdi object obtained with estimate_hdi().

sample_size

Number of observations to draw from the Beta posterior to estimate HDIs for the difference in Beta distributions. Default: 1e5.

significance

Significance levels for HDIs of the difference. Default: 0.05 (= 95% HDIs).

Value

A data.frame with estimated differences across groups, HDIs for the difference and significance labels.

Examples

# NOT RUN { hdi <- estimate_hdi(df, successes_col = 'TRUTH.TP', totals_col = 'TRUTH.TOTAL', group_cols = c('Group.Id', 'Subset', 'Type', 'Subtype')) hdi_diff <- compare_hdi(happy_hdi = hdi) # }