diff --git a/assumptions.R b/assumptions.R index efc60c0..69e991a 100644 --- a/assumptions.R +++ b/assumptions.R @@ -2,9 +2,9 @@ # Changeable Assumptions #----------------------------------------------------------------------------------------------------------------------# -# Economic Assumptions: +# Basic Assumptions: discount_rate <- 0.03 -retirement_age <- 64 # This is more or less set in stone by the IAB data. We cannot go higher only lower. +retirement_age <- 64 # This is more or less set in stone by the IAB data. We cannot go higher than 64 only lower. wage_growth_rate <- 0.005 # Tax System Assumptions: @@ -22,7 +22,7 @@ global_income_fraction_of_long_term_care_contribution <- 0 # The fraction of une global_welfare_benefit_monthly <- 700 value_added_tax <- 0.19 -# Behaviroal reponses to taxation +# Behavioural responses to taxation cost_of_raising_public_funds <- 0.3 # Relevant for the more traditional benefit cost ratio # Elasticity of Taxable Income overwrite_eti <- FALSE # If set to true the ETI specified below is used for all tax reforms @@ -31,7 +31,7 @@ global_eti <- 0.3 # Irrelevant unless overwrite_eti == TRUE # Preferences global_relative_risk_aversion <- 2 -# Value of statistical Life and Injuries: +# Value of statistical life and injuries: use_single_statistical_life_value <- TRUE # If set to true only one statistical life value has to be specified. All of the # other values for injuries and the differentiation between resource cost and risk value are derived from the value set # in value_of_statistical_life @@ -90,7 +90,7 @@ excluded_from_deflating <- c("taxReform2005", order_of_categories <- c("Top Tax Reform", "Education", "Job Training", - "Start up Subsidy", + "Start-Up Subsidy", "Subsidized Employment", "Other Labor Market Policies", "Unemployment Insurance", @@ -98,7 +98,8 @@ order_of_categories <- c("Top Tax Reform", "Climate Policy", "Health Program", "Other") #This determines the order in which the reforms categories are displayed in the graphs -# and tables. +# and tables. If a new category is added (or a existing is renamed this has to be updated). Otherwise the program crashes +# when trying to calculate category averages. # Exclude Programs from category average: excluded_from_category_average <- c("bicycleHelmet", "coronavirusLockdownR1") diff --git a/functions.R b/functions.R index 31737fa..f31e1c8 100644 --- a/functions.R +++ b/functions.R @@ -74,8 +74,10 @@ getPointEstimates <- function(programs) { mvpf_results <- data.frame(program = programs) for (i in 1:length(programs)) { message(paste("Running", programs[i], "once to get the point estimate.")) + # Call program "i" and store the return values return_values <- do.call(programs[i], list()) + # Deflate unless deflating is explicitely disabled. if (!programs[i] %in% excluded_from_deflating) { return_values <- deflateReturnValues(return_values, results_prices) } @@ -86,13 +88,15 @@ getPointEstimates <- function(programs) { mvpf_results[names(return_values), ] <- unlist(return_values) next } + # Store the return values in the results data.frame mvpf_results[i, names(return_values)] <- unlist(return_values) + # Calculate the MVPF and also store it in the results data.frame mvpf_results[i, "mvpf"] <- calculateMVPF(mvpf_results[i, "willingness_to_pay"], mvpf_results[i, "government_net_costs"]) } return(mvpf_results) } -# Run Programs without priting messages +# Run Programs without printing messages quietelyRunPrograms <- function(programs, bootstrap = FALSE) { results <- suppressMessages(getPointEstimates(programs)) if (bootstrap) { @@ -712,7 +716,7 @@ getCategoryPlotData <- function(plot_data, bootstrap_results, include_additional return(1 - bootstrap_results$government_net_costs / bootstrap_results$program_cost) }) - # Calculate numerator and denominator as before expcet that the result now is a vector with number of bootstrap replications rows: + # Calculate numerator and denominator as before except that the result now is a vector with 'number of bootstrap replications' rows: numerator_bootstrap <- 1 / ncol(willingness_to_pay_per_euro) * rowSums(willingness_to_pay_per_euro) denominator_bootstrap <- 1 / ncol(willingness_to_pay_per_euro) * (-rowSums(fiscal_externality_per_euro) + ncol(fiscal_externality_per_euro)) @@ -1063,7 +1067,7 @@ getTaxSystemEffects <- function(gross_income, # Higher pension contributions result in higher pension payments but due to demographics the return is probably quite low. # adapted from: - # 'Identifying Laffer Bounds: A Sufficient-Statistics Approach with an Application to Germany' by Sachs and Lorenz (2015) Appendix A + # 'Identifying Laffer Bounds: A Sufficient-Statistics Approach with an Application to Germany' by Lorenz and Sachs (2015) Appendix A # and their supplementary excel file # Calculations are for a single household without children diff --git a/main.R b/main.R index 41e928e..f7db549 100644 --- a/main.R +++ b/main.R @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------------------------------------------------# -# Unified Welfare Analysis for Germany using MVPFs (Marginal Value of Public Funds) +# Unified Welfare Analysis for Germany using the MVPF (Marginal Value of Public Funds) #----------------------------------------------------------------------------------------------------------------------# # Clear the environment: @@ -37,7 +37,7 @@ if (length(not_installed_packages) > 0) { break } else if (confirmation == "n") { - stop("Need to have required packages installed. Exiting...") + stop("Need to have the required packages installed. Exiting...") } } } @@ -129,7 +129,7 @@ plotResults(plot_data = plot_data, # Figure that plots the Net Costs of all policies against the year they were implemented (with text lables) plotResults(plot_data = plot_data, y_axis = "government_net_costs_per_program_cost", - y_label = "Net Costs per Euro Progammatic Expenditure", + y_label = "Net Costs per Euro Programmatic Expenditure", x_axis = "year", x_label = "Year", save = "cost_against_year.pdf", lower_cutoff = 0, @@ -140,7 +140,7 @@ plotResults(plot_data = plot_data, # Figure that plots the WTP of all policies against the year they were implemented (with text lables) plotResults(plot_data = plot_data, y_axis = "willingness_to_pay_per_program_cost", - y_label = "Willingness to Pay per Euro Progammatic Expenditure", + y_label = "Willingness to Pay per Euro Programmatic Expenditure", x_axis = "year", x_label = "Year", save = "wtp_against_year.pdf", lower_cutoff = 0, @@ -236,7 +236,7 @@ robustnessCheck(programs, global_flat_tax <<- 0.5 } }, - headlines = c("τ = 0.1", "Only Income Tax", "Taxes and Transfers (Baseline)", "τ = 0.5"), + headlines = c("τ = 0.1", "Only Income Tax", "German Tax and Transfer System (Baseline)", "τ = 0.5"), overwrite_bootstrap_replications = 100, save = "robustness_check_tax_rate.pdf") @@ -255,7 +255,7 @@ robustnessCheck(programs, yearly_return_to_schooling <<- 0.11 } else if (specification == 4) { - # Baseline + # nothing baseline } }, headlines = c("RTS = 5%", "RTS = 8%", " RTS = 11%", "IAB Data (Baseline)"), @@ -270,7 +270,4 @@ cat("Robustness checks completed in ", difftime(Sys.time(), start_time, units='m #exportPlotCSV(programs, assumption_list = getListOfAllMetaAssumptions(), bootstrap = FALSE, meta_assumptions = TRUE) # Export Tables: -exportLatexTables(plot_data) - -# Copy Files: -FolderCopy() \ No newline at end of file +exportLatexTables(plot_data) \ No newline at end of file diff --git a/web/csv/readme.txt b/web/csv/readme.txt new file mode 100644 index 0000000..0fa1eca --- /dev/null +++ b/web/csv/readme.txt @@ -0,0 +1,3 @@ +the files generated by +exportPlotCSV(programs, assumption_list = getListOfAllMetaAssumptions(), bootstrap = FALSE, meta_assumptions = TRUE) +need to be placed here. \ No newline at end of file diff --git a/web/variables.json b/web/variables.json deleted file mode 100644 index 6772097..0000000 --- a/web/variables.json +++ /dev/null @@ -1,235 +0,0 @@ -[ - { - program: "taxReform1990", - willingness_to_pay: { - willingness_to_pay: "Tax Reduction", - }, - government_net_costs: { - willingness_to_pay: "Tax Reduction", - fiscal_externality: "Fiscal Externality" - } - }, - { - program: "taxReform2000", - willingness_to_pay: { - willingness_to_pay: "Tax Reduction", - }, - government_net_costs: { - willingness_to_pay: "Tax Reduction", - fiscal_externality: "Fiscal Externality" - } - }, - { - program: "BestUpInformationWorkshop", - willingness_to_pay: { - net_income_increase: "Lifteime Effect on Net Income", - bafoeg_cost: "Bafög Receipt", - bafoeg_repayment: "Bafög Repayment" - }, - government_net_costs: { - program_cost: "Workshop Cost", - tax_revenue_increase: "Lifteime Tax Revenue Increase", - education_cost: "Education Cost Difference", - bafoeg_cost: "Bafög Payment", - bafoeg_repayment: "Bafög Repayment" - } - }, - { - program: "mentoringBalu", - willingness_to_pay: { - net_income_increase: "Lifteime Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Mentor, Mentee pair", - tax_revenue_increase: "Lifteime Tax Revenue Increase", - education_cost: "Education Cost Difference" - } - }, - { - program: "G8", - willingness_to_pay: { - net_income_increase: "Liftetime Effect on Net Income", - earlier_labor_market_participation_net_income: "Earlier Labor Force Participation" - }, - government_net_costs: { - earlier_labor_market_participation_tax_revenue: "Tax Revenue from Earlier Labor Force Participation", - tax_revenue_increase: "Lifteime Tax Revenue Decrease", - education_cost: "Education Cost Difference" - } - }, - { - program: "tuitionFees", - willingness_to_pay: { - net_income_increase: "Liftetime Effect on Net Income", - program_cost: "Tuition Fees" - }, - government_net_costs: { - program_cost: "Tuition Fees", - education_cost: "Education Cost Difference", - tax_revenue_increase: "Lifteime Tax Revenue Decrease", - } - }, - { - program: "longTraining", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Training Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "shortTraining", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Training Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "practiceFirm", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Participation Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "retraining", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Training Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "classRoomTraining", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Training Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "trainingMeasures", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Training Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "bridgingAllowance", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Paying Subsidy", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "startupSubsidy", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Paying Subsidy", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "startupGrant", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Paying Start up Grant", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "trainingVoucher", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Training Cost", - tax_revenue_increase: "Tax Revenue Increase" - } - }, - { - program: "speedLimitA3", - willingness_to_pay: { - cost_increased_travel_time: "Cost of Longer Travel Time", - private_safer_traffic_valuation: "Private Valuation of fewer Accidents", - private_fuel_cost_saving: "Lower Fuel Consumption", - local_emission_reduction: "Less Local Emissions", - co2_emission_reducation: "Less CO2 Emissions" - }, - government_net_costs: { - public_safer_traffic_valuation: "Public Valuation of fewer Accidents", - energy_tax_loss: "Energy Tax Loss", - value_added_tax_loss: "VAT Loss" - } - }, - { - program: "speedLimitA61", - willingness_to_pay: { - cost_increased_travel_time: "Cost of Longer Travel Time", - private_safer_traffic_valuation: "Private Valuation of fewer Accidents", - private_fuel_cost_saving: "Lower Fuel Consumption", - local_emission_reduction: "Less Local Emissions", - co2_emission_reducation: "Less CO2 Emissions" - }, - government_net_costs: { - public_safer_traffic_valuation: "Public Valuation of fewer Accidents", - energy_tax_loss: "Energy Tax Loss", - value_added_tax_loss: "VAT Loss" - } - }, - { - program: "jobCreationSchemes", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Job Creation Scheme", - tax_revenue_increase: "Tax Revenue Increase", - benefit_receipt: "Effect on Welfare Benefits" - } - }, - { - program: "oneEuroJobs", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Job Creation Scheme", - tax_revenue_increase: "Tax Revenue Increase", - benefit_receipt: "Effect on Welfare Benefits" - } - }, - { - program: "subsidizedJobOpportunities", - willingness_to_pay: { - net_income_increase: "Effect on Net Income" - }, - government_net_costs: { - program_cost: "Cost of Job Creation Scheme", - tax_revenue_increase: "Tax Revenue Increase", - benefit_receipt: "Effect on Welfare Benefits" - } - } -] \ No newline at end of file