Skip to contents

Constructs the contingency table Region_AtTimeOfPlacement x Region_MostRecentPlacement and reports the chi-square statistic, Cramer's V, and the share of placements on the diagonal (within-region staying) vs off-diagonal (cross-region churn). Ontario seg/RC placement is overwhelmingly diagonal (locality-preserving) in the public release.

Usage

mrm_otis_region_locality(
  data,
  region_at_col = "Region_AtTimeOfPlacement",
  region_recent_col = "Region_MostRecentPlacement"
)

Arguments

data

A data.frame with region_at_col and region_recent_col.

region_at_col

Column name of the at-placement region (default "Region_AtTimeOfPlacement").

region_recent_col

Column name of the most-recent region (default "Region_MostRecentPlacement").

Value

A list with named elements table (the contingency matrix), chi2, df, p_value, morie_cramers_v, diagonal_share, off_diagonal_share.

Examples

if (FALSE) {
  b01 <- read.csv("b01_segregation_detailed_dataset.csv")
  mrm_otis_region_locality(b01)
}