Per-variable taxonomy + dispatcher (R mirror of morie.variable_taxonomy)
Source:R/variable_taxonomy.R
variable_taxonomy.RdClassifies every column in OTIS / ARSAU datasets by Stevens-1946 level of measurement (nominal / ordinal / interval / ratio + the practical extensions boolean / date / datetime / identifier / free-text), cardinality, functional role (identifier / outcome / covariate / weight / metadata), and cross-year safety.
Details
Drives a method dispatcher (morie_recommended_summary,
morie_recommended_pair_test) that picks the right
statistical analysis per variable based on its measurement level.
Hard-coded invariant overrides (the data dictionary itself states these, but we encode them in code so analyses cannot accidentally violate them):
OTIS
UniqueIndividual_ID: random per-fiscal-year reassignment ->cross_year_safe = FALSE,role = "identifier". Cross-year joins on this column are statistically meaningless.ARSAU
BatchFileName/Indiv_Index: per- incident identifiers ->role = "identifier".ARSAU
IndivInjuries_PhysicalInjuries: boolean injury outcome ->role = "outcome".