Chi-square: charges-recommended independent of year?
Source:R/siu_analyze.R
morie_siu_charges_by_year_chi2.RdCross-tabulates charges_recommended against incident-year
and tests independence with a Pearson chi-square (
stats::chisq.test; p-value via stats::pchisq). Years with
zero charge-decided cases are dropped. Complements
morie_siu_verify_chi2 in sprott_doob.R, which
tests specific published 2x2 tables; this is a generic "did the
charge rate move?" probe over the harvested SIU corpus.
Arguments
- data
Either a data frame (e.g. the output of
morie_fetch_siu()read in) or a path toSIU_by_case.csv.NULL(the default) looks infile.path(tempdir(), "morie", "siu", "SIU_by_case.csv").