Skip to content
Christy Lam edited this page Feb 28, 2022 · 13 revisions

OFM April 1 data

Update: Download, tidy, and export data to staging area in Elmer via R.

  1. Open files: config.R, run.R
  2. Follow instructions in run.R and run line by line where necessary.

In Elmer, you can find staged tables in stg.ofm_apr_intercensal, stg.ofm_apr_postcensal, and stg.ofm_apr_postcensal_housing.

  1. Once staging tables have been officially incorporated to the main tables, knit the .Rmd in subfolder process > OFM > summary to view an html data summary of post-censal estimates in Elmer.

CHAS data import

CHAS_ETL.R This script reads CHAS data from the HUD website, downloads it, unzips it, and puts it in the Elmer staging database. Prior to running the script make the following edits to the year(s) in the filenames. Visit the website to see what year ranges are available.

  1. Revise line 9 data_file_name <- '<yyyy>thru<yyyy>-140-csv.zip.zip'.
  2. Revise line 44 data_dict_name <- 'CHAS data dictionary <yy>-<yy>.xlsx.xlsx'
  3. Revise line 46 elmer_table_name <- 'chas_tbl_9_<yyyy>'

For more information visit: https://www.huduser.gov/portal/datasets/cp.html.

Additional background info can be found here: http://aws-linux/mediawiki/index.php/Comprehensive_Housing_Affordability_Strategy_(CHAS)

After the data has been put in the staging database, addition scripts in process/CHAS is used to put the data into facts and dimensions and add geographic information.

CHAS Query API

CHAS_API.R allows you to query county level summaries for the PSRC region via the CHAS API. Running the script 'as-is' will pull the latest county-level data for the region.

The API is equivalent to the Query tab on their interface.

Tract level data is not available but the following summaries can be obtained via API:

  • Nation
  • State
  • County
  • MCD
  • Place
Clone this wiki locally