dyadrt
Dyadic offending rates
dyadrt(count, pop)crimlab.dyadrt(count, pop)crimlab dyadrt --count VALUE --pop VALUEOffences by one group against another, as a rate per member of the
offending group and as a rate per offender-victim pair exposed. The rate
per offender rises with the size of the victim group even when offenders
choose victims at random; the rate per pair does not. See
proof("dyadrt").
Parameters
Section titled “Parameters”countA square matrix (or 2-d table) of offence counts, offending group in rows and victim group in columns: non-negative numbers. When it names both its rows and its columns, the columns are matched to the rows by name, and both to
popwhenpopis named.popGroup sizes: positive numbers, as a numeric vector, a 1-d table, a list of single numbers or a one-row data frame. Unnamed, they are taken in the order of the rows: only names protect against a mismatch.
Returns
Section titled “Returns”A data frame with one row per dyad: off, vic, count,
rtoff, rtpair, nulloff (the rate per offender under random
mixing) and ratio (rtpair over the pooled pair rate; 1 under
random mixing).
Examples
Section titled “Examples”pop <- c(a = 800, b = 200)dyadrt(count = outer(pop, pop) / 1000, pop = pop)Generated from the R help page: dyadrt in the R reference.