Skip to contents

Pearson chi-square + Cramer's V on every meaningful 2-way slice of the c-series datasets. Honour to Prof. Doob's chi-square tradition in Canadian corrections research.

Usage

morie_otis_analyze_c_chi2(
  datasets,
  contingency_value = "NumberIndividuals_RestrictiveConfinement",
  out_dir = NULL
)

Arguments

datasets

Named list of c-series data.frames (e.g. list(c03 = otis_c03, c04 = otis_c04, ...)).

contingency_value

Count column to pivot on (default "NumberIndividuals_RestrictiveConfinement").

out_dir

Optional output directory.

Value

morie_otis_analysis_result.

Examples

# \donttest{
otis_c03 <- morie_synth_otis("c03", n = 120L, seed = 1L)
otis_c04 <- morie_synth_otis("c04", n = 120L, seed = 1L)
morie_otis_analyze_c_chi2(list(c03 = otis_c03, c04 = otis_c04))
#> OTIS c-series -- chi^2 + Cramer's V family on demographic contingency tables
#> ============================================================================
#>   Contingency value column  NumberIndividuals_RestrictiveConfinement
#>   Slices tested             7
#> 
#> Contingency chi^2 and Cramer's V on c-series slices (value = NumberIndividuals_RestrictiveConfinement):
#>   Dataset  Slice                                      n     chi^2     dof  p          Cramer's V  min cell
#>   --------------------------------------------------------------------------------------------------------
#>   c03      Race x Gender                              4395  334.099   9    1.50e-66   0.2757      78
#>   c04      Race x Region_MostRecentPlacement          4395  1637.186  36   2.95e-321  0.3052      0
#>   c05      Religion x Region_MostRecentPlacement      0     n/a       0    n/a        n/a         0
#>   c06      Age_Category x Region_MostRecentPlacement  0     n/a       0    n/a        n/a         0
#>   c07      Alert_Type x Gender                        0     n/a       0    n/a        n/a         0
#>   c08      Religion x Gender                          0     n/a       0    n/a        n/a         0
#>   c09      Age_Category x Gender                      0     n/a       0    n/a        n/a         0
#> 
#> Cramer's V is the canonical effect-size measure for chi^2 independence on 2-way contingency tables: V~0 -> independence, V->1 -> strong association. p<.05 with V<0.1 ==> statistically detectable but practically tiny. 
# }