Skip to content

The Policy Rules Database (PRD) contains up-to-date program rules and provisions for all major federal and state public assistance programs, tax provisions, and tax credits.

License

Notifications You must be signed in to change notification settings

jdebacker/policy-rules-database

Repository files navigation

Policy Rules Database (PRD)

The Policy Rules Database (PRD) is an open-source repository that contains up-to-date rules and provisions for all major federal and state public assistance programs, taxes, and tax credits in a single easy-to-use database.

  • Subscribe to receive email updates about new features of the Policy Rules Database

  • To learn more, visit the PRD website

  • Read PRD Technical Manual to get started with the PRD and to learn details about each program included in the database

  • Analyze the structure of the U.S. social safety net using PRD Dashboard

The terms of the PRD use are defined by the GNU General Public License v3.0. If you are interested in alternative licensing arrangements, please contact [email protected]

Citing the Policy Rules Database

Ilin, Elias and Ellyn Terry. 2021. 'The Policy Rules Database.' Federal Reserve Bank of Atlanta. Available at www.frbatlanta.org/economic-mobility-and-resilience/advancing-careers-forlow-income-families/policy-rules-database.aspx.

How to Use This Repository?

Step 1: Download the repository

Download and unzip this repository to your local machine. Make sure you have R and RStudio installed.

Step 2: Specify settings of the simulation - family characteristics and public benefits

Open TEST.yml file located in the projects folder. Adjust each input accordingly.

Step 3: Run the simulation

Open applyBenefitsCalculator.R and run the program.

Step 4: Explore the results

Results of the simulation are saved as a csv file in the output folder.

Step 5 (Optional): Modify and Explore

The PRD GitHub repository gives users flexibility in how to use the database. That includes:

  • Using PRD Excel files with the policy parameters located in prd_parameters_excel folder

  • Modifying benefits_functions.R located in functions folder to produce policy simulations

  • Applying PRD calculations to external datasets (CPS, ACS, SIPP etc) for microsimulation purposes

Description of Each File Included in This Repository

This folder contains the following files:

1. "PRD Technical Manual.pdf"

This document provides detailed information on each public assistance program and tax credit included in the PRD. The document also describes the programming steps necessary to implement the calculations for each program in any programming language.

2. "prd_parameters" folder

Contains main Policy Rules Database parameters files in RData format. These files are then used by the PRD functions to produce the calculations

The following files are located in this folder:

  1. benefit.parameters.RData - eligibility & benefits parameters for each public assistance programs and tax credit included into the PRD
  2. expenses.RData - parameters from the supplementary cost-of-living database that can be used to retrieve information required to implement PRD calculations
  3. parameters.defaults.RData - default parameters used elsewhere in the PRD calculations (such as number of school days, number of summer days etc)
  4. tables.RData - supplemental tables and crosswalks (e.g. SMIs, FPLs, state FIPS to state name mapping etc)

3. "prd_parameters_excel" folder

Contains the PRD parameters in the alternative Excel format

4. "functions" folder

Contains main Policy Rules Database functions written in R programming language. These functions read-in parameters from (1) and determine eligibility/calculate the dollar value of benefits for each program.

The following files are located in this folder:

  1. benefits_functions.R - functions that read-in PRD parameters and determine eligibility/calculate value of benefits for each public assistance program and tax credit contained in the PRD
  2. expense_functions.R - functions that assign default expenses using Cost of Living Database
  3. BenefitsCalculator_functions.R - higher-level program that aggregates smaller functions into blocks (Expenses, Childcare, Healthcare, Food and Housing, Taxes and Tax Credits, Other Benefits)

5. applyBenefitsCalculator.R

High-level program that runs the Benfits Calculator in its entirety

6. libraries.R

Packages and libraries required to run example codes below

7. "projects" folder

YML files that are used to provide the specification for the PRD (i.e. specify the family demographics and benefits composition to run through the PRD). TEST.yml is then read-in by the applyBenefitsCalculator.R program and produces calculations

To test changes/run PRD you can do the following:

  1. In projects folder, copy TEST.yml to YOUR_NAME.yml
  2. Open YOUR_NAME.yml file in any text editor; adust specifications as needed
  3. Open applyBenefitsCalculator.R; specify PROJECT object as YOUR_NAME
  4. Run the program. Results are saved to the "output" folder as results_YOUR_NAME.csv file

8. "output" folder

applyBenefitsCalculator.R program saves the resulted output into this folder

How to Use the Unit Test

A unit test is a way of testing the smallest piece of code that can be logically isolated in a system.

These steps should be carried out only once:

  1. Execute the following command library(here)
  2. Create an object with the path where the files are downloaded.

proj_dir <-"/Users/....."

  1. Execute the following command setwd(proj_dir)
  2. Execute the following command set_here()
  3. Open the file run_test.R directly from the folder where it is saved.

To test the functions:

  1. Run the script named run_test.R

About

The Policy Rules Database (PRD) contains up-to-date program rules and provisions for all major federal and state public assistance programs, tax provisions, and tax credits.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages