From 1e26fab1b5fe769606171e101f0c2515e9fb5d7f Mon Sep 17 00:00:00 2001 From: vrathi101 <72925608+vrathi101@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:30:27 +0000 Subject: [PATCH 1/4] Model take-up of itemized medical deduction --- changelog_entry.yaml | 4 ++++ .../irs/deductions/itemized/medical/takeup.yaml | 10 ++++++++++ .../itemizing/medical_expense_deduction.py | 8 +++++++- .../takes_up_itemized_medical_deduction.py | 14 ++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml create mode 100644 policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..21cdb81d26e 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Itemized medical deduction take-up. diff --git a/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml b/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml new file mode 100644 index 00000000000..ef21ebd75bc --- /dev/null +++ b/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml @@ -0,0 +1,10 @@ +description: The share of eligible taxpayers who claim the itemized medical deduction. +values: + 20224-01-01: 0.505 +metadata: + period: year + unit: /1 + label: Itemized medical deduction takeup rate + reference: + - title: Subsidizing Medical Spending Through the Tax Code: Take-Up, Targeting and the Cost of Claiming + href: https://www.nber.org/system/files/working_papers/w33213/w33213.pdf#page=2 diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/medical_expense_deduction.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/medical_expense_deduction.py index c815eb8be92..9a62a14079a 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/medical_expense_deduction.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/medical_expense_deduction.py @@ -11,7 +11,13 @@ class medical_expense_deduction(Variable): documentation = "Medical expenses deducted from taxable income." def formula(tax_unit, period, parameters): + takes_up_itemized_medical_deduction = tax_unit( + "takes_up_itemized_medical_deduction", period + ) expense = add(tax_unit, period, ["medical_out_of_pocket_expenses"]) medical = parameters(period).gov.irs.deductions.itemized.medical medical_floor = medical.floor * tax_unit("positive_agi", period) - return max_(0, expense - medical_floor) + return ( + max_(0, expense - medical_floor) + * takes_up_itemized_medical_deduction + ) diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py new file mode 100644 index 00000000000..a630de02e86 --- /dev/null +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py @@ -0,0 +1,14 @@ +from policyengine_us.model_api import * + + +class takes_up_itemized_medical_deduction(Variable): + value_type = bool + entity = TaxUnit + label = "Takes up the itemized medical deduction" + definition_period = YEAR + + def formula(tax_unit, period, parameters): + if not hasattr(tax_unit.simulation, "dataset"): + return True + takeup_rate = parameters(period).gov.irs.deductions.medical.takeup + return random(tax_unit) < takeup_rate From 1865b2c30edc3a8935d73555899355e558b73906 Mon Sep 17 00:00:00 2001 From: vrathi101 <72925608+vrathi101@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:34:53 +0000 Subject: [PATCH 2/4] format fix --- .../parameters/gov/irs/deductions/itemized/medical/takeup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml b/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml index ef21ebd75bc..e57e30f0c12 100644 --- a/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml +++ b/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml @@ -6,5 +6,5 @@ metadata: unit: /1 label: Itemized medical deduction takeup rate reference: - - title: Subsidizing Medical Spending Through the Tax Code: Take-Up, Targeting and the Cost of Claiming + - title: Subsidizing Medical Spending Through the Tax Code - Take-Up, Targeting and the Cost of Claiming href: https://www.nber.org/system/files/working_papers/w33213/w33213.pdf#page=2 From 312d4c0e894e57c6145d1e6a03e8f7ea3e110bdb Mon Sep 17 00:00:00 2001 From: vrathi101 <72925608+vrathi101@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:37:51 +0000 Subject: [PATCH 3/4] fixing yaml --- .../parameters/gov/irs/deductions/itemized/medical/takeup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml b/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml index e57e30f0c12..874f616f9cd 100644 --- a/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml +++ b/policyengine_us/parameters/gov/irs/deductions/itemized/medical/takeup.yaml @@ -1,6 +1,6 @@ description: The share of eligible taxpayers who claim the itemized medical deduction. values: - 20224-01-01: 0.505 + 2024-01-01: 0.505 metadata: period: year unit: /1 From 5c5164702676722f397d6eaa7c8aa27ba7b77a79 Mon Sep 17 00:00:00 2001 From: vrathi101 <72925608+vrathi101@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:19:49 +0000 Subject: [PATCH 4/4] update path --- .../itemizing/takes_up_itemized_medical_deduction.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py index a630de02e86..1f19ef12b81 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/takes_up_itemized_medical_deduction.py @@ -10,5 +10,7 @@ class takes_up_itemized_medical_deduction(Variable): def formula(tax_unit, period, parameters): if not hasattr(tax_unit.simulation, "dataset"): return True - takeup_rate = parameters(period).gov.irs.deductions.medical.takeup + takeup_rate = parameters( + period + ).gov.irs.deductions.itemized.medical.takeup return random(tax_unit) < takeup_rate