compare
Compare Irish statistics across counties or councils: rank areas by a stat, check if two stats are comparable, or get details on a vetted comparison pair.
Instructions
Four modes, depending on which arguments are given -- consolidates what
were four separate tools (rank_areas, list_comparisons, get_comparison,
check_comparability) behind one, since they are all really "how does this
stat compare" at different scopes. Exactly one mode's arguments should be
given; mixing arguments from different modes (e.g. both stat_key and
pair_key, or only one of stat_key_a/stat_key_b) raises an error
rather than silently guessing which mode was meant.
stat_keyalone (nopair_key, nostat_key_a/stat_key_b): ranks every area at one geography level by its latest figure for that stat, for one country -- e.g. "which counties have the highest median sale price" (country="ireland").stat_keycomes fromquery_data's dataset-listing mode, for the SAME country.levelomitted uses this ranking's own default level; pass one of that dataset's owncompatible_levelsfor a different one -- a level this ranking doesn't have registered returns an empty list rather than an error. Where the underlying stat has no honest per-area denominator (crime, homelessness, live_register and similar -- StatsMapped's own RANKING_NO_DENOMINATOR_STATS), each row'srate_per_1000is the real figure to rank/compare by, notlatest_value, which is a raw count dominated by area population size. Always carry forward every entry incaveatswhen using a row in an answer.pair_keyalone: full detail for one registered comparison pair -- each axis's label, unit and publisher, the correlation stats (r, rho, and a leave-one-out sensitivity range naming the single most influential area), and caveats.pair_keycomes from mode 4's own response, for the SAME country.Both
stat_key_aandstat_key_bgiven: does StatsMapped have a registered, hand-vetted comparison between these two stats? Registry-backed only -- never computes a fresh correlation for an arbitrary pair. Both stat_keys come fromquery_data's dataset- listing mode, for the SAME country.comparableis one of"yes"(a real, hand-vetted registered pair -- only this case may be treated as a confirmed relationship),"no"(a real structural impossibility, the two stats share no geography level at all), or"unknown"(not registered, not ruled out either -- StatsMapped genuinely hasn't vetted this pair; never treat this as "probably comparable"). Readreasonsbefore deciding how to present any answer other than"yes".None of the above given: lists every registered cross-dataset comparison pair for one country -- e.g. "median sale price vs new dwelling completions per 1,000 residents". A small, hand-curated set, not an arbitrary-pair engine: pass one of the returned
pair_keyvalues to mode 2 for the real correlation and axis detail.levelis only meaningful together withstat_key(mode 1); giving it withoutstat_keyraises rather than silently dropping it and falling through to mode 4's unrelated pair listing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ||
| country | No | ireland | |
| pair_key | No | ||
| stat_key | No | ||
| stat_key_a | No | ||
| stat_key_b | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |