-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: "US Hardship Index" | ||
output: | ||
md_document: | ||
variant: markdown_github | ||
|
||
rmarkdown::html_vignette: | ||
self_contained: no | ||
--- | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
```{r opts, echo = FALSE} | ||
knitr::opts_chunk$set ( | ||
collapse = TRUE, | ||
warning = TRUE, | ||
message = TRUE, | ||
width = 120, | ||
comment = "#>", | ||
fig.retina = 2, | ||
fig.path = "README-" | ||
) | ||
``` | ||
|
||
[![R build | ||
status](https://github.com/UrbanAnalyst/us-hardship-index/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/us-hardship-index/actions?query=workflow%3AR-CMD-check) | ||
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | ||
|
||
|
||
# US Hardship Index | ||
|
||
`us-hardship-index` is an R package for calculating a hardship index for | ||
specified US states. It includes the single primary function | ||
`hs_hardship_index()`, which accepts the two parameters of: | ||
|
||
- "state" for the desired US state; and | ||
- "year" for the desired year (with values available since 2010). | ||
|
||
The index itself is calculated from the methodology of "*An Update on Urban | ||
Hardship*," by Lisa M. Monteil, Richard P. Nathan, and David J. Wright (2004), | ||
*The Nelson A. Rockefeller Institute of Goverment*. It is formed as a multiple | ||
of the following six measures, each standardised to unit (or percentage) | ||
scales: | ||
|
||
- *occupancy*: Proportion of rooms with > 1 occupant per room; | ||
- *poverty*: Proportion of households below poverty line; | ||
- *unemployment*: Proportion of unemployed adults; | ||
- *no_hs*: Proportion of population without highschool diploma | ||
- *deps*: Proportion of population who may be considered dependent; that is | ||
either under 18 or over 65 | ||
- *income*: Per-capita income | ||
|
||
All variables are quantified such that lower values are better, except for | ||
income. The hardship index is then simply the product of those six metrics, | ||
again standardised to a unit (or percentage) scale. An example of the index in | ||
action is provided by [the city of Chicago]( | ||
https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-socioeconomic-indicators-in-C/kn9c-c2s2/data), | ||
as a table of the six metrics plus their conversion to a composite hardship | ||
index. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
[![R build | ||
status](https://github.com/UrbanAnalyst/us-hardship-index/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/us-hardship-index/actions?query=workflow%3AR-CMD-check) | ||
[![Project Status: | ||
Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | ||
|
||
# US Hardship Index | ||
|
||
`us-hardship-index` is an R package for calculating a hardship index for | ||
specified US states. It includes the single primary function | ||
`hs_hardship_index()`, which accepts the two parameters of: | ||
|
||
- “state” for the desired US state; and | ||
- “year” for the desired year (with values available since 2010). | ||
|
||
The index itself is calculated from the methodology of “*An Update on | ||
Urban Hardship*,” by Lisa M. Monteil, Richard P. Nathan, and David J. | ||
Wright (2004), *The Nelson A. Rockefeller Institute of Goverment*. It is | ||
formed as a multiple of the following six measures, each standardised to | ||
unit (or percentage) scales: | ||
|
||
- *occupancy*: Proportion of rooms with \> 1 occupant per room; | ||
- *poverty*: Proportion of households below poverty line; | ||
- *unemployment*: Proportion of unemployed adults; | ||
- *no_hs*: Proportion of population without highschool diploma | ||
- *deps*: Proportion of population who may be considered dependent; that | ||
is either under 18 or over 65 | ||
- *income*: Per-capita income | ||
|
||
All variables are quantified such that lower values are better, except | ||
for income. The hardship index is then simply the product of those six | ||
metrics, again standardised to a unit (or percentage) scale. An example | ||
of the index in action is provided by [the city of | ||
Chicago](https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-socioeconomic-indicators-in-C/kn9c-c2s2/data), | ||
as a table of the six metrics plus their conversion to a composite | ||
hardship index. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
RFILE = README | ||
VIGNETTE = parallel | ||
|
||
all: init vignette | ||
|
||
init: | ||
echo "pkgdown::init_site()" | R --no-save -q | ||
|
||
site: | ||
echo "pkgdown::build_site()" | R --no-save q | ||
|
||
vignette: | ||
echo "pkgdown::build_article('$(VIGNETTE)',quiet=FALSE)" | R --no-save -q | ||
|
||
knith: $(RFILE).Rmd | ||
echo "rmarkdown::render('$(RFILE).Rmd',output_file='$(RFILE).html')" | R --no-save -q | ||
|
||
doc: clean | ||
Rscript -e 'devtools::document()' | ||
Rscript -e 'rmarkdown::render("$(RFILE).Rmd",rmarkdown::md_document(variant="gfm"))' | ||
|
||
open: | ||
xdg-open docs/articles/$(VIGNETTE).html & | ||
|
||
check: | ||
Rscript -e 'library(pkgcheck); checks <- pkgcheck(); print(checks); summary (checks)' | ||
|
||
clean: | ||
rm -rf *.html *.png README_cache docs/ |