Skip to contents

Yearly trend (d01 Poisson CIs) + Alert x Cause / Housing contingency chi^2 + Cramer's V on d06 / d07.

Usage

morie_otis_analyze_d_chi2(datasets, out_dir = NULL)

Arguments

datasets

Named list with d01, d06, d07 data.frames.

out_dir

Optional output directory.

Value

morie_otis_analysis_result.

Examples

# \donttest{
otis_d01 <- morie_synth_otis("d01", n = 120L, seed = 1L)
otis_d06 <- morie_synth_otis("d06", n = 120L, seed = 1L)
otis_d07 <- morie_synth_otis("d07", n = 120L, seed = 1L)
morie_otis_analyze_d_chi2(list(d01 = otis_d01,
                                 d06 = otis_d06, d07 = otis_d07))
#> OTIS d-series -- yearly death counts + Alert x Cause/Housing chi^2
#> ==================================================================
#>   d01 total deaths                       120
#>   d01 year range                         2018-2024
#>   Year-over-year RR                      1.000 (2024/2018; n=19/19; 95% CI [0.529, 1.889])
#>   d06 (Alert x MedicalCause) Cramer's V  0.2226
#>   d07 (Alert x Housing_Type) Cramer's V  n/a
#> 
#> d01 yearly custodial-death counts (Poisson 95% CI):
#>   Year  Deaths  95% CI
#>   --------------------------
#>   2018  19      [11.4, 29.7]
#>   2019  18      [10.7, 28.4]
#>   2020  13      [6.9, 22.2]
#>   2021  15      [8.4, 24.7]
#>   2022  15      [8.4, 24.7]
#>   2023  21      [13.0, 32.1]
#>   2024  19      [11.4, 29.7]
#> 
#> d06 / d07 Alert-flag x outcome contingency chi^2 + Cramer's V:
#>   Dataset  Slice                 n     chi^2    dof  p          Cramer's V  min cell
#>   ----------------------------------------------------------------------------------
#>   d06      Alert x MedicalCause  4939  489.428  6    1.59e-102  0.2226      103
#>   d07      Alert x Housing_Type  0     n/a      0    n/a        n/a         0
#> 
#> d-series carries no per-individual alert columns -- the Ruhela alert-complexity dual is structurally impossible. Natural alternatives are: (1) yearly death-count trends, and (2) Cramer's V on d06 / d07 aggregate contingency tables. 
# }