dspbm
Benchmark decomposition of a disparity
dspbm(pop, contact, force, ref = 1)crimlab.dspbm(pop, contact, force, ref=None)crimlab dspbm --pop VALUE --contact VALUE --force VALUE [--ref VALUE]Splits each group’s disparity in force per resident, against a reference
group, into a disparity in contact per resident times a disparity in force
per contact. The split is a product, never a sum. See proof("dspbm").
Parameters
Section titled “Parameters”popResidents by group: positive numbers, as a numeric vector, a 1-d table, a list of single numbers or a one-row data frame.
contactPolice contacts by group: positive numbers, in the forms of
pop; named inputs are matched topopby name, unnamed ones by position (only names protect against a mismatch).forceUses of force by group: positive numbers, in the forms of
pop, matched by name.refThe reference group, by name (matched exactly, case included; a factor by its label) or by position in
popas given.
Returns
Section titled “Returns”A data frame with one row per group, in the order of pop:
group, ref (TRUE for the reference group), cd (contact per
resident), fd (force per contact) and rd (force per resident), each
against the reference group, with rd = cd * fd.
Examples
Section titled “Examples”dspbm(pop = c(a = 9000, b = 1000), contact = c(a = 900, b = 300), force = c(a = 9, b = 6))Generated from the R help page: dspbm in the R reference.