From 9ee1ab7a3db5e64b7310887e4af8cda002c71c54 Mon Sep 17 00:00:00 2001 From: Ziming Date: Mon, 15 Sep 2025 21:57:58 -0400 Subject: [PATCH] draft --- changelog_entry.yaml | 4 + .../ssdi/family_maximum/max_percentage.yaml | 13 ++ .../ssdi/family_maximum/min_percentage.yaml | 13 ++ .../ssa/ssdi/family_maximum/percentage.yaml | 13 ++ .../gov/ssa/ssdi/pia/bend_points/first.yaml | 14 +++ .../gov/ssa/ssdi/pia/bend_points/second.yaml | 14 +++ .../gov/ssa/ssdi/pia/percentages/first.yaml | 13 ++ .../gov/ssa/ssdi/pia/percentages/second.yaml | 13 ++ .../gov/ssa/ssdi/pia/percentages/third.yaml | 13 ++ .../parameters/gov/ssa/ssdi/sga/blind.yaml | 15 +++ .../gov/ssa/ssdi/sga/non_blind.yaml | 15 +++ .../gov/ssa/ssdi/waiting_period.yaml | 12 ++ .../standard_requirement.yaml | 13 ++ .../age_24_to_31/age_threshold.yaml | 11 ++ .../age_24_to_31/base_age.yaml | 13 ++ .../age_24_to_31/credits_multiplier.yaml | 13 ++ .../under_24/age_threshold.yaml | 11 ++ .../under_24/credits_required.yaml | 13 ++ .../under_24/years_period.yaml | 11 ++ .../work_credits/recent_credits_standard.yaml | 13 ++ .../recent_work/standard_requirement.yaml | 13 ++ .../recent_work/years_considered.yaml | 11 ++ .../half_of_years_since_21.yaml | 13 ++ .../ssdi/work_credits/recent_work_years.yaml | 14 +++ .../ssdi/work_credits/required_credits.yaml | 13 ++ .../young_worker/age_24_to_31_base_age.yaml | 14 +++ .../young_worker/age_24_to_31_multiplier.yaml | 13 ++ .../young_worker/age_24_to_31_threshold.yaml | 14 +++ .../young_worker/under_24_age_threshold.yaml | 14 +++ .../under_24_credits_required.yaml | 13 ++ .../young_worker/under_24_years_period.yaml | 14 +++ .../baseline/gov/ssa/ssdi/integration.yaml | 113 ++++++++++++++++++ .../gov/ssa/ssdi/is_ssdi_eligible.yaml | 76 ++++++++++++ .../gov/ssa/ssdi/ssdi_family_maximum.yaml | 49 ++++++++ .../gov/ssa/ssdi/ssdi_individual_benefit.yaml | 50 ++++++++ .../baseline/gov/ssa/ssdi/ssdi_pia.yaml | 54 +++++++++ .../gov/ssa/ss/social_security_disability.py | 5 +- .../ssa/ssdi/eligibility/is_ssdi_disabled.py | 31 +++++ .../ssa/ssdi/eligibility/is_ssdi_eligible.py | 30 +++++ .../meets_ssdi_work_history_requirements.py | 54 +++++++++ .../ssdi/eligibility/ssdi_engaged_in_sga.py | 27 +++++ .../eligibility/ssdi_recent_work_credits.py | 17 +++ .../ssa/ssdi/eligibility/ssdi_work_credits.py | 17 +++ .../variables/gov/ssa/ssdi/ssdi_aime.py | 19 +++ .../gov/ssa/ssdi/ssdi_family_maximum.py | 31 +++++ .../gov/ssa/ssdi/ssdi_individual_benefit.py | 27 +++++ .../gov/ssa/ssdi/ssdi_months_waiting.py | 19 +++ .../variables/gov/ssa/ssdi/ssdi_pia.py | 45 +++++++ 48 files changed, 1059 insertions(+), 1 deletion(-) create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/family_maximum/max_percentage.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/family_maximum/min_percentage.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/family_maximum/percentage.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/first.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/second.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/first.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/second.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/third.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/sga/blind.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/sga/non_blind.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/waiting_period.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/standard_requirement.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/age_threshold.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/base_age.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/credits_multiplier.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/age_threshold.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/credits_required.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/years_period.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_credits_standard.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/standard_requirement.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/years_considered.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/young_worker_requirements/half_of_years_since_21.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work_years.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/required_credits.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_base_age.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_multiplier.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_threshold.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_age_threshold.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_credits_required.yaml create mode 100644 policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_years_period.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/ssa/ssdi/integration.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/ssa/ssdi/is_ssdi_eligible.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_family_maximum.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_individual_benefit.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_pia.yaml create mode 100644 policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_disabled.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_eligible.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/eligibility/meets_ssdi_work_history_requirements.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_engaged_in_sga.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_recent_work_credits.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_work_credits.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/ssdi_aime.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/ssdi_family_maximum.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/ssdi_individual_benefit.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/ssdi_months_waiting.py create mode 100644 policyengine_us/variables/gov/ssa/ssdi/ssdi_pia.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..f9ad0efbfb7 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Social Security Disability Insurance (SSDI). diff --git a/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/max_percentage.yaml b/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/max_percentage.yaml new file mode 100644 index 00000000000..9d6179c6d50 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/max_percentage.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration sets this maximum percentage of Primary Insurance Amount as the ceiling for family maximum benefits under Social Security Disability Insurance. + +values: + 1975-01-01: 1.5 + +metadata: + rate_unit: /1 + label: SSA SSDI family maximum maximum percentage of PIA + reference: + - title: Social Security Administration - Formula for Family Maximum Benefit + href: https://www.ssa.gov/oact/cola/familymax.html + - title: 42 U.S. Code § 403(a)(2)(A) - Family maximum benefit formula + href: https://www.law.cornell.edu/uscode/text/42/403#a_2_A diff --git a/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/min_percentage.yaml b/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/min_percentage.yaml new file mode 100644 index 00000000000..477291ad4b6 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/min_percentage.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration sets this minimum percentage of Primary Insurance Amount as the floor for family maximum benefits under Social Security Disability Insurance. + +values: + 1975-01-01: 1.0 + +metadata: + rate_unit: /1 + label: SSA SSDI family maximum minimum percentage of PIA + reference: + - title: Social Security Administration - Formula for Family Maximum Benefit + href: https://www.ssa.gov/oact/cola/familymax.html + - title: 42 U.S. Code § 403(a)(2)(A) - Family maximum benefit formula + href: https://www.law.cornell.edu/uscode/text/42/403#a_2_A diff --git a/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/percentage.yaml b/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/percentage.yaml new file mode 100644 index 00000000000..92f1531fefc --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/family_maximum/percentage.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration calculates the family maximum benefit as this percentage of Average Indexed Monthly Earnings for Social Security Disability Insurance cases. + +values: + 1975-01-01: 0.85 + +metadata: + rate_unit: /1 + label: SSA SSDI family maximum percentage of AIME + reference: + - title: Social Security Administration - Formula for Family Maximum Benefit + href: https://www.ssa.gov/oact/cola/familymax.html + - title: 42 U.S. Code § 403(a)(2)(A) - Family maximum benefit formula + href: https://www.law.cornell.edu/uscode/text/42/403#a_2_A diff --git a/policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/first.yaml b/policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/first.yaml new file mode 100644 index 00000000000..860a7d425c1 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/first.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration uses this first bend point in the Primary Insurance Amount calculation formula for Social Security Disability Insurance benefits. + +values: + 2024-01-01: 1_174 + +metadata: + unit: USD + period: month + label: SSA SSDI PIA first bend point + reference: + - title: Social Security Administration - Benefit Formula Bend Points + href: https://www.ssa.gov/oact/cola/bendpoints.html + - title: 42 U.S. Code § 415(a)(1)(A) - Primary insurance amount formula + href: https://www.law.cornell.edu/uscode/text/42/415#a_1_A diff --git a/policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/second.yaml b/policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/second.yaml new file mode 100644 index 00000000000..36f89440134 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/pia/bend_points/second.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration uses this second bend point in the Primary Insurance Amount calculation formula for Social Security Disability Insurance benefits. + +values: + 2024-01-01: 7_078 + +metadata: + unit: USD + period: month + label: SSA SSDI PIA second bend point + reference: + - title: Social Security Administration - Benefit Formula Bend Points + href: https://www.ssa.gov/oact/cola/bendpoints.html + - title: 42 U.S. Code § 415(a)(1)(A) - Primary insurance amount formula + href: https://www.law.cornell.edu/uscode/text/42/415#a_1_A diff --git a/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/first.yaml b/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/first.yaml new file mode 100644 index 00000000000..31754e73207 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/first.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration applies this percentage to Average Indexed Monthly Earnings up to the first bend point in the Primary Insurance Amount calculation for Social Security Disability Insurance benefits. + +values: + 1979-01-01: 0.9 + +metadata: + rate_unit: /1 + label: SSA SSDI PIA first percentage + reference: + - title: Social Security Administration - Primary Insurance Amount + href: https://www.ssa.gov/oact/cola/piaformula.html + - title: 42 U.S. Code § 415(a)(1)(A)(i) - Primary insurance amount formula + href: https://www.law.cornell.edu/uscode/text/42/415#a_1_A_i diff --git a/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/second.yaml b/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/second.yaml new file mode 100644 index 00000000000..0a3b00eab7d --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/second.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration applies this percentage to Average Indexed Monthly Earnings between the first and second bend points in the Primary Insurance Amount calculation for Social Security Disability Insurance benefits. + +values: + 1979-01-01: 0.32 + +metadata: + rate_unit: /1 + label: SSA SSDI PIA second percentage + reference: + - title: Social Security Administration - Primary Insurance Amount + href: https://www.ssa.gov/oact/cola/piaformula.html + - title: 42 U.S. Code § 415(a)(1)(A)(ii) - Primary insurance amount formula + href: https://www.law.cornell.edu/uscode/text/42/415#a_1_A_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/third.yaml b/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/third.yaml new file mode 100644 index 00000000000..5104835964e --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/pia/percentages/third.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration applies this percentage to Average Indexed Monthly Earnings above the second bend point in the Primary Insurance Amount calculation for Social Security Disability Insurance benefits. + +values: + 1979-01-01: 0.15 + +metadata: + rate_unit: /1 + label: SSA SSDI PIA third percentage + reference: + - title: Social Security Administration - Primary Insurance Amount + href: https://www.ssa.gov/oact/cola/piaformula.html + - title: 42 U.S. Code § 415(a)(1)(A)(iii) - Primary insurance amount formula + href: https://www.law.cornell.edu/uscode/text/42/415#a_1_A_iii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/sga/blind.yaml b/policyengine_us/parameters/gov/ssa/ssdi/sga/blind.yaml new file mode 100644 index 00000000000..0053e1d8744 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/sga/blind.yaml @@ -0,0 +1,15 @@ +description: The Social Security Administration considers blind individuals earning more than this amount to be engaged in Substantial Gainful Activity for Social Security Disability Insurance purposes. + +values: + 2024-01-01: 2_590 + 2025-01-01: 2_700 + +metadata: + unit: USD + period: month + label: SSA SSDI blind SGA threshold + reference: + - title: Social Security Administration - Substantial Gainful Activity + href: https://www.ssa.gov/oact/cola/sga.html + - title: 42 U.S. Code § 423(d)(4) - Substantial gainful activity framework + href: https://www.law.cornell.edu/uscode/text/42/423#d_4 diff --git a/policyengine_us/parameters/gov/ssa/ssdi/sga/non_blind.yaml b/policyengine_us/parameters/gov/ssa/ssdi/sga/non_blind.yaml new file mode 100644 index 00000000000..14ca4fd1910 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/sga/non_blind.yaml @@ -0,0 +1,15 @@ +description: The Social Security Administration considers non-blind individuals earning more than this amount to be engaged in Substantial Gainful Activity for Social Security Disability Insurance purposes. + +values: + 2024-01-01: 1_550 + 2025-01-01: 1_620 + +metadata: + unit: USD + period: month + label: SSA SSDI non-blind SGA threshold + reference: + - title: Social Security Administration - Substantial Gainful Activity + href: https://www.ssa.gov/oact/cola/sga.html + - title: 42 U.S. Code § 423(d)(4) - Substantial gainful activity framework + href: https://www.law.cornell.edu/uscode/text/42/423#d_4 diff --git a/policyengine_us/parameters/gov/ssa/ssdi/waiting_period.yaml b/policyengine_us/parameters/gov/ssa/ssdi/waiting_period.yaml new file mode 100644 index 00000000000..76991a4929e --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/waiting_period.yaml @@ -0,0 +1,12 @@ +description: The Social Security Administration requires a waiting period of this many months after disability onset before Social Security Disability Insurance benefits begin. + +values: + 1975-01-01: 5 + +metadata: + unit: month + period: month + label: SSDI waiting period + reference: + - title: 42 U.S. Code § 423(c)(2) - Waiting period for disability benefits + href: https://www.law.cornell.edu/uscode/text/42/423#c_2 diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/standard_requirement.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/standard_requirement.yaml new file mode 100644 index 00000000000..9a65944fae0 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/standard_requirement.yaml @@ -0,0 +1,13 @@ +description: Standard total work credits required for SSDI eligibility (40 quarters of coverage) + +values: + 1975-01-01: 40 + +metadata: + unit: credit + label: SSDI standard work credit requirement + reference: + - title: Social Security Administration - How You Earn Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html + - title: 42 U.S. Code § 423(c)(1)(B)(i) - Definition of insured status + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_i diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/age_threshold.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/age_threshold.yaml new file mode 100644 index 00000000000..320fe20d83b --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/age_threshold.yaml @@ -0,0 +1,11 @@ +description: Upper age threshold for young worker graduated credit requirement (31 years old) + +values: + 1975-01-01: 31 + +metadata: + unit: year + label: SSDI young worker upper age threshold + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/base_age.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/base_age.yaml new file mode 100644 index 00000000000..8bb2f8f8cee --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/base_age.yaml @@ -0,0 +1,13 @@ +description: Base age for calculating graduated credit requirements (age 21) + +values: + 1975-01-01: 21 + +metadata: + unit: year + label: SSDI young worker base age for credit calculation + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii + - title: SSA - Disability Benefits + href: https://www.ssa.gov/benefits/disability/qualify.html diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/credits_multiplier.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/credits_multiplier.yaml new file mode 100644 index 00000000000..f940746d998 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/age_24_to_31/credits_multiplier.yaml @@ -0,0 +1,13 @@ +description: Multiplier for calculating credits required (2 credits per year after age 21) + +values: + 1975-01-01: 2 + +metadata: + unit: credit/year + label: SSDI young worker credit multiplier + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii + - title: SSA - Disability Benefits + href: https://www.ssa.gov/benefits/disability/qualify.html diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/age_threshold.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/age_threshold.yaml new file mode 100644 index 00000000000..5823f08515f --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/age_threshold.yaml @@ -0,0 +1,11 @@ +description: Age threshold for young worker exception (under 24 years old) + +values: + 1975-01-01: 24 + +metadata: + unit: year + label: SSDI young worker age threshold (under 24) + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/credits_required.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/credits_required.yaml new file mode 100644 index 00000000000..a32386217b3 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/credits_required.yaml @@ -0,0 +1,13 @@ +description: Work credits required for workers under age 24 (6 credits in 3-year period) + +values: + 1975-01-01: 6 + +metadata: + unit: credit + label: SSDI credits required for workers under 24 + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii + - title: SSA - Disability Benefits + href: https://www.ssa.gov/benefits/disability/qualify.html diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/years_period.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/years_period.yaml new file mode 100644 index 00000000000..3a4e970d0ff --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/duration_of_work/young_worker_requirements/under_24/years_period.yaml @@ -0,0 +1,11 @@ +description: Period in years for which credits must be earned for workers under 24 + +values: + 1975-01-01: 3 + +metadata: + unit: year + label: SSDI credit period for workers under 24 + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_credits_standard.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_credits_standard.yaml new file mode 100644 index 00000000000..1529567a175 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_credits_standard.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration requires this many work credits to be earned in the recent work period for standard Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 20 + +metadata: + unit: credit + label: SSA SSDI recent credits requirement + reference: + - title: Social Security Administration - How You Earn Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html + - title: 42 U.S. Code § 423(c)(1)(B)(i) - Recent work requirement + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_i diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/standard_requirement.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/standard_requirement.yaml new file mode 100644 index 00000000000..704d53e4a55 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/standard_requirement.yaml @@ -0,0 +1,13 @@ +description: Standard recent work credits required for SSDI (20 credits in last 10 years) + +values: + 1975-01-01: 20 + +metadata: + unit: credit + label: SSDI standard recent work requirement + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(i) - Recent work test + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_i + - title: SSA - Disability Benefits + href: https://www.ssa.gov/benefits/disability/qualify.html diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/years_considered.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/years_considered.yaml new file mode 100644 index 00000000000..d8c5f65f49a --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/years_considered.yaml @@ -0,0 +1,11 @@ +description: Number of years considered for recent work test + +values: + 1975-01-01: 10 + +metadata: + unit: year + label: SSDI recent work period + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(i) - Recent work test + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_i diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/young_worker_requirements/half_of_years_since_21.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/young_worker_requirements/half_of_years_since_21.yaml new file mode 100644 index 00000000000..e6162220598 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work/young_worker_requirements/half_of_years_since_21.yaml @@ -0,0 +1,13 @@ +description: Young workers need credits in half the years since turning 21 + +values: + 1975-01-01: 0.5 + +metadata: + unit: /1 + label: SSDI young worker recent work fraction + reference: + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker recent work test + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii + - title: SSA - Disability Benefits for Young Workers + href: https://www.ssa.gov/benefits/disability/qualify.html diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work_years.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work_years.yaml new file mode 100644 index 00000000000..e10815bd26a --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/recent_work_years.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration requires half of work credits to be earned within this many recent years for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 10 + +metadata: + unit: year + period: year + label: SSA SSDI recent work years requirement + reference: + - title: Social Security Administration - How You Earn Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html + - title: 42 U.S. Code § 423(c)(1)(B) - Recent work requirements + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/required_credits.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/required_credits.yaml new file mode 100644 index 00000000000..0cd7c25901a --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/required_credits.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration requires this many total work credits for full Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 40 + +metadata: + unit: credit + label: SSA SSDI required work credits + reference: + - title: Social Security Administration - How You Earn Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html + - title: 42 U.S. Code § 423(c)(1) - Work credit requirements + href: https://www.law.cornell.edu/uscode/text/42/423#c_1 diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_base_age.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_base_age.yaml new file mode 100644 index 00000000000..a4730c2fec6 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_base_age.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration subtracts this age from the worker's current age to calculate required work credits for workers aged 24 to 31 for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 21 + +metadata: + unit: year + period: year + label: SSA SSDI young worker age 24 to 31 base age + reference: + - title: Social Security Administration - Young Worker Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html#h3 + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_multiplier.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_multiplier.yaml new file mode 100644 index 00000000000..57219c8210d --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_multiplier.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration multiplies the years since age 21 by this factor to determine required work credits for workers aged 24 to 31 for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 2 + +metadata: + unit: credit + label: SSA SSDI young worker age 24 to 31 multiplier + reference: + - title: Social Security Administration - Young Worker Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html#h3 + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_threshold.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_threshold.yaml new file mode 100644 index 00000000000..34f48e49ad2 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/age_24_to_31_threshold.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration applies special work credit calculation for disabled workers between age 24 and this age for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 31 + +metadata: + unit: year + period: year + label: SSA SSDI young worker age 24 to 31 threshold + reference: + - title: Social Security Administration - Young Worker Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html#h3 + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_age_threshold.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_age_threshold.yaml new file mode 100644 index 00000000000..ae19b6048a2 --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_age_threshold.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration applies special work credit requirements for disabled workers under this age for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 24 + +metadata: + unit: year + period: year + label: SSA SSDI young worker under 24 age threshold + reference: + - title: Social Security Administration - Young Worker Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html#h3 + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_credits_required.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_credits_required.yaml new file mode 100644 index 00000000000..f439054253c --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_credits_required.yaml @@ -0,0 +1,13 @@ +description: The Social Security Administration requires this many work credits in the three years before disability onset for workers under age 24 for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 6 + +metadata: + unit: credit + label: SSA SSDI young worker under 24 credits required + reference: + - title: Social Security Administration - Young Worker Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html#h3 + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_years_period.yaml b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_years_period.yaml new file mode 100644 index 00000000000..2eb6f627eeb --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssdi/work_credits/young_worker/under_24_years_period.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration looks at work credits earned in this many years before disability onset for workers under age 24 for Social Security Disability Insurance eligibility. + +values: + 1975-01-01: 3 + +metadata: + unit: year + period: year + label: SSA SSDI young worker under 24 years period + reference: + - title: Social Security Administration - Young Worker Credits + href: https://www.ssa.gov/benefits/retirement/planner/credits.html#h3 + - title: 42 U.S. Code § 423(c)(1)(B)(ii) - Young worker exception + href: https://www.law.cornell.edu/uscode/text/42/423#c_1_B_ii diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/integration.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/integration.yaml new file mode 100644 index 00000000000..4fa2334f759 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/integration.yaml @@ -0,0 +1,113 @@ +- name: Complete household with disabled worker receiving SSDI + period: 2024 + absolute_error_margin: 0.3 + input: + people: + disabled_worker: + age: 45 + is_disabled: true + ssdi_work_credits: 40 + ssdi_recent_work_credits: 20 + ssdi_aime: 72_000 # $6,000/month AIME + ssdi_months_waiting: 5 + earned_income: 6_000 # Part-time work below SGA + spouse: + age: 43 + is_disabled: false + earned_income: 30_000 + child_1: + age: 10 + is_disabled: false + child_2: + age: 14 + is_disabled: false + tax_units: + tax_unit: + members: [disabled_worker, spouse, child_1, child_2] + families: + family: + members: [disabled_worker, spouse, child_1, child_2] + households: + household: + members: [disabled_worker, spouse, child_1, child_2] + output: + # Worker eligibility + is_ssdi_eligible: [true, false, false, false] + is_ssdi_disabled: [true, false, false, false] + meets_ssdi_work_history_requirements: [true, false, false, false] + ssdi_engaged_in_sga: [false, true, false, false] # Spouse earning $30k/year > SGA + + # PIA calculation for $6,000/month: + # First: $1,174 * 0.9 = $1,056.60 + # Second: ($6,000 - $1,174) * 0.32 = $1,544.32 + # Total monthly: $2,600.92, rounded to $2,600.90 + ssdi_pia: [2_600.9, 0, 0, 0] + + # Individual benefit (after waiting period) + ssdi_individual_benefit: [2_600.9, 0, 0, 0] + + # Family maximum: 85% of monthly AIME = $5,100, constrained by 150% of PIA = $3,901.35 + ssdi_family_maximum: [3_901.35, 0, 0, 0] + +- name: Young disabled worker with limited work history + period: 2024 + input: + people: + young_worker: + age: 25 + is_disabled: true + is_blind: false + ssdi_work_credits: 8 # (25-21)*2 = 8 credits needed + ssdi_recent_work_credits: 8 + ssdi_aime: 36_000 # $3,000/month + ssdi_months_waiting: 6 + earned_income: 0 + tax_units: + tax_unit: + members: [young_worker] + families: + family: + members: [young_worker] + households: + household: + members: [young_worker] + output: + is_ssdi_eligible: true + meets_ssdi_work_history_requirements: true + # PIA for $3,000/month calculated earlier: $1,640.90 + ssdi_pia: 1_640.9 + ssdi_individual_benefit: 1_640.9 + +- name: Blind worker with higher SGA threshold + period: 2024 + absolute_error_margin: 0.3 + input: + people: + blind_worker: + age: 50 + is_blind: true + is_disabled: false + ssdi_work_credits: 40 + ssdi_recent_work_credits: 20 + ssdi_aime: 84_000 # $7,000/month + ssdi_months_waiting: 5 + earned_income: 30_000 # $2,500/month - below blind SGA of $2,700 + tax_units: + tax_unit: + members: [blind_worker] + families: + family: + members: [blind_worker] + households: + household: + members: [blind_worker] + output: + is_ssdi_eligible: true + is_ssdi_disabled: true # Blind qualifies as disabled + ssdi_engaged_in_sga: false # Below blind SGA threshold + # PIA calculation for $7,000/month: + # First: $1,174 * 0.9 = $1,056.60 + # Second: ($7,000 - $1,174) * 0.32 = $1,864.32 + # Total monthly: $2,920.92, rounded to $2,920.90 + ssdi_pia: 2_920.9 + ssdi_individual_benefit: 2_920.9 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/is_ssdi_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/is_ssdi_eligible.yaml new file mode 100644 index 00000000000..7e1a24af293 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/is_ssdi_eligible.yaml @@ -0,0 +1,76 @@ +- name: Eligible disabled person with sufficient work history + period: 2024 + input: + is_disabled: true + is_blind: false + ssdi_work_credits: 40 + ssdi_recent_work_credits: 20 + earned_income: 12_000 # $1,000/month, below SGA + age: 45 + output: + is_ssdi_disabled: true + meets_ssdi_work_history_requirements: true + ssdi_engaged_in_sga: false + is_ssdi_eligible: true + +- name: Not eligible - engaged in substantial gainful activity + period: 2024 + input: + is_disabled: true + ssdi_work_credits: 40 + ssdi_recent_work_credits: 20 + earned_income: 24_000 # $2,000/month, above SGA + age: 45 + output: + ssdi_engaged_in_sga: true + is_ssdi_eligible: false + +- name: Not eligible - insufficient work credits + period: 2024 + input: + is_disabled: true + ssdi_work_credits: 30 + ssdi_recent_work_credits: 15 + earned_income: 6_000 + age: 45 + output: + meets_ssdi_work_history_requirements: false + is_ssdi_eligible: false + +- name: Blind person with higher SGA threshold + period: 2024 + input: + is_blind: true + is_disabled: false + ssdi_work_credits: 40 + ssdi_recent_work_credits: 20 + earned_income: 30_000 # $2,500/month, below blind SGA + age: 50 + output: + is_ssdi_disabled: true + ssdi_engaged_in_sga: false + is_ssdi_eligible: true + +- name: Young worker exception - age 23 + period: 2024 + input: + is_disabled: true + ssdi_work_credits: 6 + ssdi_recent_work_credits: 6 + earned_income: 6_000 + age: 23 + output: + meets_ssdi_work_history_requirements: true + is_ssdi_eligible: true + +- name: Young worker exception - age 28 + period: 2024 + input: + is_disabled: true + ssdi_work_credits: 14 # (28-21)*2 = 14 + ssdi_recent_work_credits: 10 + earned_income: 6_000 + age: 28 + output: + meets_ssdi_work_history_requirements: true + is_ssdi_eligible: true diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_family_maximum.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_family_maximum.yaml new file mode 100644 index 00000000000..6f86d17be8d --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_family_maximum.yaml @@ -0,0 +1,49 @@ +- name: Family maximum at 85% of AIME within constraints + period: 2024 + absolute_error_margin: 0.3 + input: + ssdi_aime: 60_000 # $5,000/month + ssdi_pia: 2_280.9 + output: + # 85% of monthly AIME: $5,000 * 0.85 = $4,250 + # Min (100% of PIA): $2,280.9 + # Max (150% of PIA): $3,421.35 + # Result: min($4,250, $3,421.35) = $3,421.35 + ssdi_family_maximum: 3_421.35 + +- name: Family maximum constrained by minimum percentage + period: 2024 + input: + ssdi_aime: 24_000 # $2,000/month + ssdi_pia: 1_400 # Monthly PIA for this AIME + output: + # 85% of monthly AIME: $2,000 * 0.85 = $1,700 + # Min (100% of PIA): $1,400 + # Max (150% of PIA): $2,100 + # Result: max($1,700, $1,400) = $1,700 + ssdi_family_maximum: 1_700 + +- name: Family maximum at exactly 100% of PIA + period: 2024 + input: + ssdi_aime: 12_000 # $1,000/month + ssdi_pia: 900 + output: + # 85% of monthly AIME: $1,000 * 0.85 = $850 + # Min (100% of PIA): $900 + # Max (150% of PIA): $1,350 + # Result: max($850, $900) = $900 + ssdi_family_maximum: 900 + +- name: High earner family maximum at 150% cap + period: 2024 + absolute_error_margin: 0.3 + input: + ssdi_aime: 120_000 # $10,000/month + ssdi_pia: 3_384.1 + output: + # 85% of monthly AIME: $10,000 * 0.85 = $8,500 + # Min (100% of PIA): $3,384.1 + # Max (150% of PIA): $5,076.15 + # Result: min($8,500, $5,076.15) = $5,076.15 + ssdi_family_maximum: 5_076.15 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_individual_benefit.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_individual_benefit.yaml new file mode 100644 index 00000000000..2bd6d03878e --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_individual_benefit.yaml @@ -0,0 +1,50 @@ +- name: Eligible person receives full PIA after waiting period + period: 2024 + absolute_error_margin: 0.3 + input: + is_ssdi_eligible: true + ssdi_aime: 60_000 # $5,000/month + ssdi_months_waiting: 5 # Completed 5-month waiting period + output: + # PIA calculation for $5,000/month AIME: + # First: $1,174 * 0.9 = $1,056.60 + # Second: ($5,000 - $1,174) * 0.32 = $1,224.32 + # Total monthly: $2,280.92, rounded down to $2,280.90 + ssdi_pia: 2_280.9 + ssdi_individual_benefit: 2_280.9 + +- name: Eligible but still in waiting period + period: 2024 + absolute_error_margin: 0.3 + input: + is_ssdi_eligible: true + ssdi_aime: 60_000 + ssdi_months_waiting: 3 # Only 3 months, need 5 + output: + ssdi_pia: 2_280.9 + ssdi_individual_benefit: 0 + +- name: Not eligible receives no benefit + period: 2024 + input: + is_ssdi_eligible: false + ssdi_aime: 60_000 + ssdi_months_waiting: 6 + output: + ssdi_individual_benefit: 0 + +- name: High earner at maximum benefit level + period: 2024 + absolute_error_margin: 0.3 + input: + is_ssdi_eligible: true + ssdi_aime: 120_000 # $10,000/month + ssdi_months_waiting: 5 + output: + # PIA calculation for $10,000/month: + # First: $1,174 * 0.9 = $1,056.60 + # Second: ($7,078 - $1,174) * 0.32 = $1,889.28 + # Third: ($10,000 - $7,078) * 0.15 = $438.30 + # Total monthly: $3,384.18, rounded down to $3,384.10 + ssdi_pia: 3_384.1 + ssdi_individual_benefit: 3_384.1 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_pia.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_pia.yaml new file mode 100644 index 00000000000..a0ebfd10c59 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssdi/ssdi_pia.yaml @@ -0,0 +1,54 @@ +- name: PIA calculation with AIME below first bend point + period: 2024 + input: + ssdi_aime: 12_000 # $1,000/month + output: + # Monthly: $1,000 * 0.9 = $900 + ssdi_pia: 900 + +- name: PIA calculation with AIME at first bend point + period: 2024 + input: + ssdi_aime: 14_088 # $1,174/month (first bend point) + output: + # Monthly: $1,174 * 0.9 = $1,056.60 + ssdi_pia: 1_056.6 + +- name: PIA calculation with AIME between bend points + period: 2024 + input: + ssdi_aime: 36_000 # $3,000/month + output: + # Monthly calculation: + # First portion: $1,174 * 0.9 = $1,056.60 + # Second portion: ($3,000 - $1,174) * 0.32 = $1,826 * 0.32 = $584.32 + # Total monthly: $1,056.60 + $584.32 = $1,640.92 + # Rounded down to nearest $0.10: $1,640.90 + ssdi_pia: 1_640.9 + +- name: PIA calculation with AIME above second bend point + period: 2024 + absolute_error_margin: 0.3 + input: + ssdi_aime: 96_000 # $8,000/month + output: + # Monthly calculation: + # First portion: $1,174 * 0.9 = $1,056.60 + # Second portion: ($7,078 - $1,174) * 0.32 = $5,904 * 0.32 = $1,889.28 + # Third portion: ($8,000 - $7,078) * 0.15 = $922 * 0.15 = $138.30 + # Total monthly: $1,056.60 + $1,889.28 + $138.30 = $3,084.18 + # Rounded down to nearest $0.10: $3,084.10 + ssdi_pia: 3_084.1 + +- name: PIA calculation at second bend point + period: 2024 + input: + ssdi_aime: 84_936 # $7,078/month (second bend point) + output: + # Monthly calculation: + # First portion: $1,174 * 0.9 = $1,056.60 + # Second portion: ($7,078 - $1,174) * 0.32 = $5,904 * 0.32 = $1,889.28 + # Third portion: $0 + # Total monthly: $1,056.60 + $1,889.28 = $2,945.88 + # Rounded down to nearest $0.10: $2,945.80 + ssdi_pia: 2_945.8 diff --git a/policyengine_us/variables/gov/ssa/ss/social_security_disability.py b/policyengine_us/variables/gov/ssa/ss/social_security_disability.py index dec08e51897..ff317abf285 100644 --- a/policyengine_us/variables/gov/ssa/ss/social_security_disability.py +++ b/policyengine_us/variables/gov/ssa/ss/social_security_disability.py @@ -4,7 +4,10 @@ class social_security_disability(Variable): value_type = float entity = Person - definition_period = YEAR + definition_period = MONTH label = "Social Security disability benefits (SSDI)" unit = USD uprating = "gov.ssa.uprating" + reference = "https://www.ssa.gov/benefits/disability/" + + adds = ["ssdi_individual_benefit"] diff --git a/policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_disabled.py b/policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_disabled.py new file mode 100644 index 00000000000..1d4964d8ad7 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_disabled.py @@ -0,0 +1,31 @@ +from policyengine_us.model_api import * + + +class is_ssdi_disabled(Variable): + value_type = bool + entity = Person + label = "Is disabled for SSDI purposes" + definition_period = YEAR + reference = "https://www.ssa.gov/benefits/disability/qualify.html" + documentation = """ + A person is considered disabled for SSDI if: + 1. They cannot engage in substantial gainful activity (SGA) + 2. The condition has lasted or is expected to last at least 12 months or result in death + 3. They cannot do work they did before or adjust to other work + """ + + def formula(person, period, parameters): + # Per 42 USC 423(d), disability determination requires: + # - Medical evaluation of physical/mental impairments + # - Vocational assessment of ability to perform past or other work + # - Duration requirement (12+ months or expected death) + # + # Since PolicyEngine lacks access to medical records and vocational + # assessments, we use input variables as proxies for the full + # disability determination process. + # + # Note: Unlike is_ssi_disabled, this does NOT check SGA status. + # For SSDI, SGA is checked separately in is_ssdi_eligible. + is_disabled = person("is_disabled", period) + is_blind = person("is_blind", period) + return is_disabled | is_blind diff --git a/policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_eligible.py b/policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_eligible.py new file mode 100644 index 00000000000..1996cc19fc5 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/eligibility/is_ssdi_eligible.py @@ -0,0 +1,30 @@ +from policyengine_us.model_api import * + + +class is_ssdi_eligible(Variable): + value_type = bool + entity = Person + label = "Is SSDI eligible" + definition_period = YEAR + reference = "https://www.ssa.gov/benefits/disability/" + documentation = """ + Determines if a person is eligible for Social Security Disability Insurance (SSDI). + Requires meeting disability criteria, work history requirements, and not engaging in SGA. + """ + + def formula(person, period, parameters): + # Must be disabled + is_disabled = person("is_ssdi_disabled", period) + + # Must meet work history requirements + meets_work_history = person( + "meets_ssdi_work_history_requirements", period + ) + + # Must not be engaged in substantial gainful activity + not_engaged_in_sga = ~person("ssdi_engaged_in_sga", period) + + # Must have waited the required period (handled separately in benefit calculation) + # This would typically check months since disability onset + + return is_disabled & meets_work_history & not_engaged_in_sga diff --git a/policyengine_us/variables/gov/ssa/ssdi/eligibility/meets_ssdi_work_history_requirements.py b/policyengine_us/variables/gov/ssa/ssdi/eligibility/meets_ssdi_work_history_requirements.py new file mode 100644 index 00000000000..d435db6bc82 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/eligibility/meets_ssdi_work_history_requirements.py @@ -0,0 +1,54 @@ +from policyengine_us.model_api import * + + +class meets_ssdi_work_history_requirements(Variable): + value_type = bool + entity = Person + label = "Meets SSDI work history requirements" + definition_period = YEAR + reference = "https://www.ssa.gov/benefits/disability/qualify.html" + documentation = """ + Determines if person meets the work history requirements for SSDI. + Generally requires 40 credits total with 20 earned in the last 10 years. + Younger workers may qualify with fewer credits. + """ + + def formula(person, period, parameters): + p = parameters(period).gov.ssa.ssdi.work_credits + + total_credits = person("ssdi_work_credits", period) + recent_credits = person("ssdi_recent_work_credits", period) + age = person("age", period) + + # Access parameter trees + duration = p.duration_of_work + recent = p.recent_work + + # Standard requirement per 42 USC 423(c)(1)(B)(i) + standard_requirement = ( + total_credits >= duration.standard_requirement + ) & (recent_credits >= recent.standard_requirement) + + # Young worker exceptions per 42 USC 423(c)(1)(B)(ii) + under_24 = duration.young_worker_requirements.under_24 + age_24_to_31 = duration.young_worker_requirements.age_24_to_31 + + # Under 24: need specified credits in recent years + under_24_exception = where( + age < under_24.age_threshold, + recent_credits >= under_24.credits_required, + False, + ) + + # Age 24-31: credits = (age - base_age) * multiplier + age_24_to_31_exception = where( + (age >= under_24.age_threshold) + & (age <= age_24_to_31.age_threshold), + total_credits + >= (age - age_24_to_31.base_age) * age_24_to_31.credits_multiplier, + False, + ) + + young_worker_exception = under_24_exception | age_24_to_31_exception + + return standard_requirement | young_worker_exception diff --git a/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_engaged_in_sga.py b/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_engaged_in_sga.py new file mode 100644 index 00000000000..09c3501e2cf --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_engaged_in_sga.py @@ -0,0 +1,27 @@ +from policyengine_us.model_api import * + + +class ssdi_engaged_in_sga(Variable): + value_type = bool + entity = Person + label = "Engaged in Substantial Gainful Activity for SSDI" + definition_period = YEAR + reference = "https://www.ssa.gov/oact/cola/sga.html" + documentation = """ + Determines if a person is engaged in Substantial Gainful Activity (SGA). + If earning above SGA threshold, generally cannot be considered disabled for SSDI. + """ + + def formula(person, period, parameters): + p = parameters(period).gov.ssa.ssdi.sga + + # Get monthly earnings + annual_earnings = person("earned_income", period) + monthly_earnings = annual_earnings / 12 + + is_blind = person("is_blind", period) + + # Different thresholds for blind vs non-blind + sga_threshold = where(is_blind, p.blind, p.non_blind) + + return monthly_earnings > sga_threshold diff --git a/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_recent_work_credits.py b/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_recent_work_credits.py new file mode 100644 index 00000000000..3a1ad8bcb7e --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_recent_work_credits.py @@ -0,0 +1,17 @@ +from policyengine_us.model_api import * + + +class ssdi_recent_work_credits(Variable): + value_type = int + entity = Person + label = "SSDI recent work credits" + definition_period = YEAR + reference = "https://www.ssa.gov/benefits/disability/qualify.html" + documentation = """ + Number of work credits earned in the recent work period for SSDI. + Generally, 20 credits must be earned in the last 10 years for those over 31. + + Per 42 USC 423(c)(1)(B), recent work requirements vary by age. + Since PolicyEngine lacks historical earnings data, this is an input variable. + Users should provide credits earned in the recent work period. + """ diff --git a/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_work_credits.py b/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_work_credits.py new file mode 100644 index 00000000000..9392daf8656 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/eligibility/ssdi_work_credits.py @@ -0,0 +1,17 @@ +from policyengine_us.model_api import * + + +class ssdi_work_credits(Variable): + value_type = int + entity = Person + label = "SSDI work credits" + definition_period = YEAR + reference = "https://www.ssa.gov/benefits/retirement/planner/credits.html" + documentation = """ + Number of work credits earned for SSDI eligibility. + Generally, you earn 1 credit for each $1,730 in earnings (2024), up to 4 credits per year. + + Per 42 USC 413, credits are calculated from covered earnings history. + Since PolicyEngine lacks historical earnings data, this is an input variable. + Users should provide total credits earned based on their work history. + """ diff --git a/policyengine_us/variables/gov/ssa/ssdi/ssdi_aime.py b/policyengine_us/variables/gov/ssa/ssdi/ssdi_aime.py new file mode 100644 index 00000000000..8f789cf3151 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/ssdi_aime.py @@ -0,0 +1,19 @@ +from policyengine_us.model_api import * + + +class ssdi_aime(Variable): + value_type = float + entity = Person + label = "SSDI Average Indexed Monthly Earnings (AIME)" + unit = USD + definition_period = YEAR + reference = "https://www.ssa.gov/oact/cola/piaformula.html" + documentation = """ + Average Indexed Monthly Earnings used for SSDI benefit calculation. + Based on up to 35 highest-earning years of work history, indexed for wage growth. + + Per 42 USC 415(b), AIME requires indexing historical covered earnings to + national average wage levels. Since PolicyEngine lacks access to lifetime + earnings records, this is an input variable. Users should provide their + AIME as calculated by SSA or estimate based on their earnings history. + """ diff --git a/policyengine_us/variables/gov/ssa/ssdi/ssdi_family_maximum.py b/policyengine_us/variables/gov/ssa/ssdi/ssdi_family_maximum.py new file mode 100644 index 00000000000..cbbab996614 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/ssdi_family_maximum.py @@ -0,0 +1,31 @@ +from policyengine_us.model_api import * + + +class ssdi_family_maximum(Variable): + value_type = float + entity = Person + label = "SSDI family maximum benefit" + unit = USD + definition_period = MONTH + reference = "https://www.ssa.gov/oact/cola/familymax.html" + documentation = """ + Maximum total benefit payable to a disabled worker's family. + For disability cases, typically 85% of AIME but not less than 100% + or more than 150% of the worker's PIA. + """ + + def formula(person, period, parameters): + p = parameters(period).gov.ssa.ssdi.family_maximum + + aime = person("ssdi_aime", period.this_year) + monthly_aime = aime / 12 # Convert annual to monthly + pia = person("ssdi_pia", period) + + # Base calculation: 85% of monthly AIME + family_max = monthly_aime * p.percentage + + # Apply min and max constraints based on PIA + family_max = max_(family_max, pia * p.min_percentage) + family_max = min_(family_max, pia * p.max_percentage) + + return family_max diff --git a/policyengine_us/variables/gov/ssa/ssdi/ssdi_individual_benefit.py b/policyengine_us/variables/gov/ssa/ssdi/ssdi_individual_benefit.py new file mode 100644 index 00000000000..52ebfc7d172 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/ssdi_individual_benefit.py @@ -0,0 +1,27 @@ +from policyengine_us.model_api import * + + +class ssdi_individual_benefit(Variable): + value_type = float + entity = Person + label = "SSDI individual benefit" + unit = USD + definition_period = MONTH + reference = "https://www.ssa.gov/benefits/disability/" + documentation = """ + Individual SSDI benefit amount after waiting period. + Equals the Primary Insurance Amount (PIA) for eligible individuals. + """ + + def formula(person, period, parameters): + p = parameters(period).gov.ssa.ssdi + + is_eligible = person("is_ssdi_eligible", period.this_year) + pia = person("ssdi_pia", period) + + # Check if waiting period is complete + months_waiting = person("ssdi_months_waiting", period.this_year) + waiting_period_complete = months_waiting >= p.waiting_period + + # Benefit is PIA if eligible and waiting period complete + return where(is_eligible & waiting_period_complete, pia, 0) diff --git a/policyengine_us/variables/gov/ssa/ssdi/ssdi_months_waiting.py b/policyengine_us/variables/gov/ssa/ssdi/ssdi_months_waiting.py new file mode 100644 index 00000000000..0f2e40f8c33 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/ssdi_months_waiting.py @@ -0,0 +1,19 @@ +from policyengine_us.model_api import * + + +class ssdi_months_waiting(Variable): + value_type = int + entity = Person + label = "SSDI months in waiting period" + definition_period = YEAR + reference = "https://www.law.cornell.edu/uscode/text/42/423#c_2" + documentation = """ + Number of months person has been in the SSDI 5-month waiting period. + Benefits begin after the 5-month waiting period is complete. + + Per 42 USC 423(c)(2), no benefits are payable for the first 5 months + of disability. Since PolicyEngine doesn't track disability onset dates, + this is an input variable. Users should provide the number of full + months since disability onset. + """ + # Maybe we don't need this diff --git a/policyengine_us/variables/gov/ssa/ssdi/ssdi_pia.py b/policyengine_us/variables/gov/ssa/ssdi/ssdi_pia.py new file mode 100644 index 00000000000..b9393cdf9c9 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssdi/ssdi_pia.py @@ -0,0 +1,45 @@ +from policyengine_us.model_api import * + + +class ssdi_pia(Variable): + value_type = float + entity = Person + label = "SSDI Primary Insurance Amount (PIA)" + unit = USD + definition_period = MONTH + reference = "https://www.ssa.gov/oact/cola/piaformula.html" + documentation = """ + Primary Insurance Amount for SSDI, calculated using the three-tier progressive formula + based on Average Indexed Monthly Earnings (AIME). + """ + + def formula(person, period, parameters): + p = parameters(period).gov.ssa.ssdi.pia + + aime = person("ssdi_aime", period.this_year) + monthly_aime = aime / 12 # Convert annual to monthly + + # First bend point calculation + first_portion = min_(monthly_aime, p.bend_points.first) + first_amount = first_portion * p.percentages.first + + # Second bend point calculation + second_portion = max_( + 0, + min_( + monthly_aime - p.bend_points.first, + p.bend_points.second - p.bend_points.first, + ), + ) + second_amount = second_portion * p.percentages.second + + # Third portion (above second bend point) + third_portion = max_(0, monthly_aime - p.bend_points.second) + third_amount = third_portion * p.percentages.third + + # Total monthly PIA (rounded down to nearest $0.10) + monthly_pia = first_amount + second_amount + third_amount + monthly_pia = np.floor(monthly_pia * 10) / 10 + + # Return monthly amount (not annual) + return monthly_pia