You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ipd review
* refactor: changed low_pop_tracts vector
* refactor: edited ipd script
* refactor: added fields to ipd output
* style: removed excess code
* refactor: renamed vars to match previous exports
* added summary tables and file exports
* chore: deleted python folder
* fix: environment variables
* fix: moe calculations
- removes the racial minority estimated MOE, which needs to be replaced by variance replicates
* fix: adds back variance replicates for MOE calc of RM indicator
* fix: add input settings at top of script
* fix: remove white population vars as unused
* chore: documentation
---------
Co-authored-by: Michael Ruane <mruane@dvrpc.org>
Copy file name to clipboardExpand all lines: README.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ This project automates DVRPC's Indicators of Potential Disadvantage (IPD) analys
4
4
5
5
## Getting the Code and Software
6
6
7
-
1. Clone the repository.
7
+
1. Clone the repository.
8
8
2. Download and install R from https://www.r-project.org/
9
9
3. Download and install R Studio from https://www.rstudio.com/products/rstudio/#Desktop
10
10
11
-
## Installing Package Dependencies
11
+
## Installing Package Dependencies
12
12
13
-
The R script has the following dependencies:
13
+
The R script has the following dependencies:
14
14
15
15
- plyr
16
16
- here
@@ -22,32 +22,33 @@ The R script has the following dependencies:
22
22
- dplyr
23
23
- descr
24
24
25
-
If you have not previously installed the dependencies, you will need to do so. If you try to run the script without installing the packages, you will get an error message like
25
+
If you have not previously installed the dependencies, you will need to do so. If you try to run the script without installing the packages, you will get an error message like
26
26
`Error in library (name_of_package) : there is no package called 'name_of_package'`.
27
27
28
-
Install each package from R Studio's console (typically at the bottom of the screen in R Studio) with the command `install.packages('name_of_package')` (include the quotation marks).
28
+
Install each package from R Studio's console (typically at the bottom of the screen in R Studio) with the command `install.packages('name_of_package')` (include the quotation marks).
29
29
30
30
## Updating the Script for a New 5-Year Dataset
31
31
32
32
If you are running the code against a newly released 5-year ACS dataset, do the following:
33
33
34
-
1.Make a copy of the latest .R file (e.g. script-2019.R) and rename it for the year you are working on. (This is to ensure that any schema changes for a particular 5-year dataset are kept with the code for that set.)
35
-
2.Adjust the value for the `ipd_year` variable (to be the end year of the dataset).
34
+
1.Update the `ipd_year` in the `ipd.r`to be the end year of the dataset.
35
+
2.Update the `output_dir` with the output location for the files.
36
36
3. Verify the field names (listed under the `# Fields` section). Follow the link provided to check the schema for that dataset.
37
37
38
38
## Running the Code
39
39
40
-
1. Open RStudio.
40
+
1. Open RStudio.
41
41
2. Open the R file (File -> Open File)
42
-
3. Run the code by clicking the Source button or Ctrl+A followed by Ctrl+Enter.
43
-
44
-
If you see an error about packages not being installed, see [Installing Package Dependencies](#installing-package-dependencies) above.
42
+
3. Run the code by clicking the Source button or Ctrl+A followed by Ctrl+Enter.
43
+
44
+
If you see an error about packages not being installed, see [Installing Package Dependencies](#installing-package-dependencies) above.
45
45
46
46
Please provide your own API Key (this is required for the `tidycensus` package, not the Census API), you may get another one [here](https://api.census.gov/data/key_signup.html).
47
47
48
-
### Outputs
48
+
### Outputs
49
49
50
50
After the code has finished, outputs are saved in the /outputs subdirectory of where you cloned the repository on your local machine, including:
51
+
51
52
- ipd.csv: tract-level statistics and scores for IPD's nine indicators
52
53
- ipd.shp: spatial version of ipd.csv
53
54
- breaks_by_indicator.csv: bin breaks by indicator
@@ -56,5 +57,6 @@ After the code has finished, outputs are saved in the /outputs subdirectory of w
56
57
- mean_by_county.csv: population-weighted county means by indicator
57
58
58
59
## Additional Information
59
-
-[documentation/discussion.pdf](https://github.com/dvrpc/ipd/blob/master/documentation/discussion.pdf) shows the essential math required to compute IPD scores.
60
+
61
+
-[documentation/discussion.pdf](https://github.com/dvrpc/ipd/blob/master/documentation/discussion.pdf) shows the essential math required to compute IPD scores.
60
62
-[documentation/script_reference.pdf](https://github.com/dvrpc/ipd/blob/master/documentation/script_reference.pdf) is a companion document to the script and explains the way the script downloads data and implements IPD analysis, code chunk by code chunk.
0 commit comments