Skip to contents

Two identities from research/lean/P2Benchmark.lean. First, with population, contact and force counts per group, the disparity of force per resident against a reference group equals the product of the disparity of contact per resident and the disparity of force per contact (Research.P2.benchmark_product); the two stages do not add (benchmark_not_additive). Second, in a log-link rate model with the exposure as an offset, scaling a group's exposure by a factor \(\kappa\) while fitting the same counts shifts that group's coefficient by exactly \(-\log\kappa\) (Research.P2.offset_shift), so a disparity ratio is identified only up to the ratio of the two groups' exposure errors (disparity_ratio_shift).

Usage

morie_disparity_benchmark(
  pop,
  contact,
  force,
  reference,
  exposure_error_factor = NULL
)

Arguments

pop, contact, force

Named numeric vectors (same names) of residents, police contacts and force incidents per group; all positive.

reference

Name of the reference group.

exposure_error_factor

Optional named vector of multiplicative errors \(\kappa_g\) in each group's exposure (1 means none); the resident-benchmark disparity is re-expressed under the corrected exposure.

Value

A data frame with one row per group: contact_disparity (contact per resident relative to the reference), force_given_contact_disparity, resident_disparity (their product), additive_claim (their sum, for comparison), log_shift and resident_disparity_corrected when exposure errors are given; attribute "theorems".

Examples

morie_disparity_benchmark(pop = c(A = 100, B = 100), contact = c(A = 30, B = 10),
                          force = c(A = 12, B = 2), reference = "B")
#>   group contact_disparity force_given_contact_disparity resident_disparity
#> 1     A                 3                             2                  6
#> 2     B                 1                             1                  1
#>   additive_claim product_check
#> 1              5  8.881784e-16
#> 2              2  0.000000e+00