This is a implementation of the "Marginal Value of Public Funds" Methodology for Germany. See https://github.com/OpportunityInsights/welfare_analysis or their paper Hendren & Sprung-Keyser (2020): A Unified Welfare Analysis of Government Policies - Quarterly Journal of Economics 2020
Download the repository, open the main.R
file and update the the working directory to point to the project folder. That's the folder where the main.R
file is located.
Assumptions and some general settings can be set in assumptions.R
. Running the R code inside main.R
runs all the programs, performs the bootstrap and exports plots to the plots
folder.
Each reform or government policy needs to have an identifier, i.e. an unique name. To add a new reform, two files and a folder have to created:
- Create a new folder in the
programs
directory named after the identifier - Copy the
exampleProgram.R
file from thesample_files
folder to the created directory and rename it toWhateverTheIdentifierIs.R
This file contains all the logic necesarry to calculate the MVPF. All of these.R
files follow the same pattern. Read the explanation inexampleProgram.R
for further details. - Add a
.xlsx
excel file namedWhateverTheIdentifierIs.xlsx
to the estimates folder. A sample file which details the contents of this file is located in the sample_files folder. - (Optional) To add the reform to the interactive Chart (see the web folder & https://mvpfde.de), a new entry to
variable_mapping.json
has to added. This file maps the return values of theWhateverTheIdentifierIs.R
file to individual effects as displayed in the bar charts. For this to work, the willingness to pay and the government net cost need to be expressable as the sum of the other return values of theWhateverTheIdentifierIs
function. See theexampleProgram.R
file in thesample_files
folder for further explanations.
The folder structure should then look like this:
Project Folder
│ README.md
│ main.R
| programs.xlsx
| variable_mapping.json
│ ...
│
└───programs
│ └───someProgramIdentifier
| | │ someProgramIdentifier.R
| |
│ └───AnotherProgramIdentifier
│ | │ AnotherProgramIdentifier.R
| |
| └───WhateverTheIdentifierIs
│ | │ WhateverTheIdentifierIs.R
| |
| ...
│
└───estimates
│ someProgramIdentifier.xlsx
│ AnotherProgramIdentifier.xlsx
| WhateverTheIdentifierIs.xlsx
| ...
Finally, a new row to programs.xlsx
may be added to add additional information about the reform such as the year, the category, the age of the benefciaries etc.
This last step is optional, but the reform will be missing in some of the graphs if the necessary information is not provided in programs.xlsx
. In general, if a program does
not match the structure from above, a hopefully informative error message should be displayed.