{"id":20599809,"url":"https://github.com/athowes/beyond-borders","last_synced_at":"2026-04-21T19:03:14.087Z","repository":{"id":50685866,"uuid":"411681110","full_name":"athowes/beyond-borders","owner":"athowes","description":"Evaluating the suitability of spatial adjacency for small-area estimation","archived":false,"fork":false,"pushed_at":"2023-12-31T21:17:53.000Z","size":74632,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T15:51:20.566Z","etag":null,"topics":["random-effects-model","small-area-estimation","spatial-statistics"],"latest_commit_sha":null,"homepage":"https://athowes.github.io/beyond-borders","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/athowes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-29T13:16:00.000Z","updated_at":"2023-06-23T11:31:39.000Z","dependencies_parsed_at":"2023-12-30T16:45:13.761Z","dependency_job_id":null,"html_url":"https://github.com/athowes/beyond-borders","commit_stats":null,"previous_names":["athowes/beyond-borders","athowes/areal-comparison"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/athowes/beyond-borders","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athowes%2Fbeyond-borders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athowes%2Fbeyond-borders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athowes%2Fbeyond-borders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athowes%2Fbeyond-borders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athowes","download_url":"https://codeload.github.com/athowes/beyond-borders/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athowes%2Fbeyond-borders/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32105868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["random-effects-model","small-area-estimation","spatial-statistics"],"created_at":"2024-11-16T08:34:14.148Z","updated_at":"2026-04-21T19:03:14.053Z","avatar_url":"https://github.com/athowes.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# beyond-borders\n\nCode for the manuscript Howes, Eaton, Flaxman \"Beyond borders: evaluating the suitability of spatial adjacency for small-area estimation\" (in preparation).\n\nSmall-area estimation models typically use the Besag model, a type of Gaussian Markov random field, to model spatial structure.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"besag.png\" width=\"500\"\u003e\n\u003c/p\u003e\n\nHowever, for irregular geometries, the assumptions made by the Besag model do not seem plausible.\nThe Besag model was designed to work well for grids, as are used in image analysis, but in small-area estimation the geometries we encounter, like the districts of a country, are more irregular.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"simulation-geometries.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\nThe goal of this work is to determine whether or not, in practice, this matters.\nTo do so, we consider the performance of eight inferential small-area models:\n\n| Model    | Function |\n|:---------|--------------|\n| Constant | [`constant_aghq`](https://github.com/athowes/arealutils/blob/master/R/constant.R) |\n| Independent and identically distributed | [`iid_aghq`](https://github.com/athowes/arealutils/blob/master/R/iid.R) |\n| Besag | [`besag_aghq`](https://github.com/athowes/arealutils/blob/master/R/besag.R) |\n| Besag-York-Mollié  2 | [`bym2_aghq`](https://github.com/athowes/arealutils/blob/master/R/bym2.R) |\n| Centroid kernel (fixed lengthscale) | [`fck_aghq`](https://github.com/athowes/arealutils/blob/master/R/fck.R) |\n| Integrated kernel (fixed lengthscale) | [`fik_aghq`](https://github.com/athowes/arealutils/blob/master/R/fik.R) |\n| Centroid kernel | [`ck_aghq`](https://github.com/athowes/arealutils/blob/master/R/ck.R) |\n| Integrated kernel | [`ik_aghq`](https://github.com/athowes/arealutils/blob/master/R/ik.R) |\n\nWe use the `aghq` package for adaptive Gauss-Hermite quadrature over a marginal Laplace approximation to conduct approximate Bayesian inference for each of the models.\nWhere possible, alternative implementions using `TMB`, `tmbstan`, `R-INLA` and `rstan` are provided by the `arealutils` package.\n\n## R package dependencies\n\nThis analysis is supported by the [`arealutils`](https://github.com/athowes/arealutils) package (I'd usually use the name `areal.utils` but C++ doesn't like having `.` in package names) which can be installed from Github via:\n\n```r\ndevtools::install_github(\"athowes/arealutils\")\n```\n\nThe [`aghq`](https://github.com/awstringer1/aghq) package is available from CRAN, though the latest development version can be installed from Github via:\n\n```r\ndevtools::install_github(\"awstringer1/aghq\")\n```\n\nAdditionally, if required, the `R-INLA` package is not currently available on CRAN, and instead may be installed by following [instructions](https://www.r-inla.org/download-install) from the project website.\n\n## File structure\n\nThe directories of this repository are:\n\n| Directory   | Contains |\n|-------------|--------------|\n| `make`      | Scripts used to run the reports. `_make.R` runs everything in order. |\n| `misc`      | Miscellaneous code, not used as part of `orderly`. |\n| `src`       | All `orderly` reports. |\n| `utils`     | Helper scripts for common development tasks. |\n\nWithin the `src` directory, reports are prefixed by a number (0-2) designating:\n\n| Prefix | Description |\n|---------------|--------------|\n| 0             | Applicable to both studies. |\n| 1             | Corresponds to the study on synthetic data. |\n| 2             | Corresponds to the study on HIV data from household surveys in sub-Saharan Africa. |\n\n## `orderly`\n\nWe use the [`orderly`](https://github.com/vimc/orderly) package ([RESIDE, 2020](https://reside-ic.github.io/)) to simplify the process of doing reproducible research.\nAfter installing [`orderly`](https://github.com/vimc/orderly) (from either CRAN or Github) a report, let's say called `example`, may be run by:\n\n```r\norderly::orderly_run(name = \"src/example\")\n```\n\nThe results of this run will appear in the `draft/` folder (ignored on Github).\nTo commit the draft (with associated `id`) to the `archive/` folder (also ignored on Github, and which should be treated as \"read only\") use:\n\n```r\norderly::orderly_commit(id)\n```\n\nAny outputs of this report will then be available to use as dependencies within other reports.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathowes%2Fbeyond-borders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathowes%2Fbeyond-borders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathowes%2Fbeyond-borders/lists"}