Skip to content

Commit c35b6bc

Browse files
baogorekclaude
andcommitted
Move all stochastic randomness to data package for deterministic country package
Remove all random() calls and seed variables from the country package. Takeup variables (ACA, SNAP, Medicaid) are now formula-less with default True. WIC uses draw variables instead of random(). SSI resource test uses only policy logic. Add state-specific Medicaid rates, Section 1931 deprivation rules, Head Start/Early Head Start takeup variables. Supersedes #6635, #7317. Fixes #7316. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dfdc54a commit c35b6bc

25 files changed

Lines changed: 349 additions & 121 deletions

changelog_entry.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- bump: minor
2+
changes:
3+
added:
4+
- State-specific Medicaid takeup rates (53%-99% range, calibrated vs uniform 93%)
5+
- Section 1931 deprivation requirement parameter for non-expansion states
6+
- is_single_parent_household variable for Medicaid deprivation rules
7+
- Head Start and Early Head Start takeup variables
8+
- WIC takeup and nutritional risk draw variables (for deterministic microsim)
9+
- SSI resource test now uses actual policy logic in individual sim
10+
changed:
11+
- Moved all stochastic randomness to data package for deterministic country package
12+
- is_parent_for_medicaid_nfc now checks Section 1931 deprivation requirements
13+
- Head Start and Early Head Start benefits now multiply by takeup
14+
- WIC would_claim_wic and is_wic_at_nutritional_risk use draw variables instead of random()
15+
removed:
16+
- aca_take_up_seed, snap_take_up_seed, medicaid_take_up_seed variables
17+
- random() calls from all variable formulas
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
description: >
2+
Whether the state requires a child to be "deprived of parental support"
3+
for parent Medicaid eligibility. This is based on Section 1931 criteria
4+
which applies to non-expansion states using pre-ACA AFDC rules.
5+
In practice, this means two-parent households generally do not qualify
6+
unless one parent is incapacitated or unemployed.
7+
metadata:
8+
label: Medicaid parent eligibility requires deprivation
9+
unit: bool
10+
period: year
11+
breakdown:
12+
- state_code
13+
reference:
14+
- title: Section 1931 Medicaid Eligibility
15+
href: https://www.law.cornell.edu/uscode/text/42/1396u-1
16+
- title: KFF - Medicaid Eligibility for Parents
17+
href: https://www.kff.org/medicaid/state-indicator/medicaid-income-eligibility-limits-for-parents/
18+
# Non-expansion states that use Section 1931 deprivation rules
19+
AL:
20+
2018-01-01: true
21+
FL:
22+
2018-01-01: true
23+
GA:
24+
2018-01-01: true
25+
KS:
26+
2018-01-01: true
27+
MS:
28+
2018-01-01: true
29+
NC:
30+
2018-01-01: true
31+
2023-12-01: false # NC expanded Medicaid
32+
SC:
33+
2018-01-01: true
34+
SD:
35+
2018-01-01: true
36+
TN:
37+
2018-01-01: true
38+
TX:
39+
2018-01-01: true
40+
WI:
41+
2018-01-01: true
42+
WY:
43+
2018-01-01: true
44+
# Expansion states - no deprivation requirement
45+
AK:
46+
2018-01-01: false
47+
AR:
48+
2018-01-01: false
49+
AZ:
50+
2018-01-01: false
51+
CA:
52+
2018-01-01: false
53+
CO:
54+
2018-01-01: false
55+
CT:
56+
2018-01-01: false
57+
DC:
58+
2018-01-01: false
59+
DE:
60+
2018-01-01: false
61+
HI:
62+
2018-01-01: false
63+
IA:
64+
2018-01-01: false
65+
ID:
66+
2018-01-01: false
67+
IL:
68+
2018-01-01: false
69+
IN:
70+
2018-01-01: false
71+
KY:
72+
2018-01-01: false
73+
LA:
74+
2018-01-01: false
75+
MA:
76+
2018-01-01: false
77+
MD:
78+
2018-01-01: false
79+
ME:
80+
2018-01-01: false
81+
MI:
82+
2018-01-01: false
83+
MN:
84+
2018-01-01: false
85+
MO:
86+
2018-01-01: false
87+
MT:
88+
2018-01-01: false
89+
ND:
90+
2018-01-01: false
91+
NE:
92+
2018-01-01: false
93+
NH:
94+
2018-01-01: false
95+
NJ:
96+
2018-01-01: false
97+
NM:
98+
2018-01-01: false
99+
NV:
100+
2018-01-01: false
101+
NY:
102+
2018-01-01: false
103+
OH:
104+
2018-01-01: false
105+
OK:
106+
2018-01-01: false
107+
OR:
108+
2018-01-01: false
109+
PA:
110+
2018-01-01: false
111+
RI:
112+
2018-01-01: false
113+
UT:
114+
2018-01-01: false
115+
VA:
116+
2018-01-01: false
117+
VT:
118+
2018-01-01: false
119+
WA:
120+
2018-01-01: false
121+
WV:
122+
2018-01-01: false
Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,116 @@
11
description: Percentage of people who do enroll in Medicaid, if eligible.
2-
values:
3-
2018-01-01: 0.93
42
metadata:
53
label: Medicaid takeup rate
64
unit: /1
75
period: year
86
economy: false
97
household: false
8+
breakdown:
9+
- state_code
1010
reference:
1111
- title: KFF "A Closer Look at the Remaining Uninsured Population Eligible for Medicaid and CHIP"
12-
href: https://www.kff.org/uninsured/issue-brief/a-closer-look-at-the-remaining-uninsured-population-eligible-for-medicaid-and-chip/#:~:text=the%20uninsured%20rate%20dropped%20to,States%20began%20the
12+
href: https://www.kff.org/uninsured/issue-brief/a-closer-look-at-the-remaining-uninsured-population-eligible-for-medicaid-and-chip/
13+
- title: State-specific rates derived from MACPAC enrollment targets vs modeled eligibility
14+
href: https://www.medicaid.gov/medicaid/program-information/medicaid-and-chip-enrollment-data/report-highlights/index.html
15+
AK:
16+
2018-01-01: 0.88
17+
AL:
18+
2018-01-01: 0.92
19+
AR:
20+
2018-01-01: 0.79
21+
AZ:
22+
2018-01-01: 0.95
23+
CA:
24+
2018-01-01: 0.78
25+
CO:
26+
2018-01-01: 0.99
27+
CT:
28+
2018-01-01: 0.89
29+
DC:
30+
2018-01-01: 0.99
31+
DE:
32+
2018-01-01: 0.86
33+
FL:
34+
2018-01-01: 0.98
35+
GA:
36+
2018-01-01: 0.73
37+
HI:
38+
2018-01-01: 0.88
39+
IA:
40+
2018-01-01: 0.84
41+
ID:
42+
2018-01-01: 0.78
43+
IL:
44+
2018-01-01: 0.85
45+
IN:
46+
2018-01-01: 0.99
47+
KS:
48+
2018-01-01: 0.92
49+
KY:
50+
2018-01-01: 0.87
51+
LA:
52+
2018-01-01: 0.79
53+
MA:
54+
2018-01-01: 0.94
55+
MD:
56+
2018-01-01: 0.95
57+
ME:
58+
2018-01-01: 0.92
59+
MI:
60+
2018-01-01: 0.91
61+
MN:
62+
2018-01-01: 0.89
63+
MO:
64+
2018-01-01: 0.89
65+
MS:
66+
2018-01-01: 0.75
67+
MT:
68+
2018-01-01: 0.83
69+
NC:
70+
2018-01-01: 0.94
71+
ND:
72+
2018-01-01: 0.91
73+
NE:
74+
2018-01-01: 0.79
75+
NH:
76+
2018-01-01: 0.84
77+
NJ:
78+
2018-01-01: 0.74
79+
NM:
80+
2018-01-01: 0.84
81+
NV:
82+
2018-01-01: 0.93
83+
NY:
84+
2018-01-01: 0.86
85+
OH:
86+
2018-01-01: 0.82
87+
OK:
88+
2018-01-01: 0.77
89+
OR:
90+
2018-01-01: 0.92
91+
PA:
92+
2018-01-01: 0.64
93+
RI:
94+
2018-01-01: 0.94
95+
SC:
96+
2018-01-01: 0.93
97+
SD:
98+
2018-01-01: 0.88
99+
TN:
100+
2018-01-01: 0.92
101+
TX:
102+
2018-01-01: 0.76
103+
UT:
104+
2018-01-01: 0.53
105+
VA:
106+
2018-01-01: 0.82
107+
VT:
108+
2018-01-01: 0.93
109+
WA:
110+
2018-01-01: 0.98
111+
WI:
112+
2018-01-01: 0.91
113+
WV:
114+
2018-01-01: 0.83
115+
WY:
116+
2018-01-01: 0.70

policyengine_us/tests/policy/baseline/gov/aca/ptc/takes_up_aca_if_eligible.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

policyengine_us/tests/policy/baseline/gov/hhs/medicaid/takes_up_medicaid_if_eligible.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

policyengine_us/tests/policy/baseline/gov/usda/snap/takes_up_snap_if_eligible.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

policyengine_us/tests/policy/baseline/gov/usda/wic/is_wic_at_nutritional_risk.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
# Nutritional risk is a health assessment per 42 U.S.C. § 1786(b)(8).
2-
# In individual simulation, all persons are assumed at nutritional risk.
2+
# In individual simulation, draw defaults to 0, so all persons in a
3+
# WIC-eligible category are assessed at nutritional risk (0 < rate).
34
# In microsimulation, risk is assigned probabilistically by category.
45

5-
- name: Case 1, infant assumed at nutritional risk in individual simulation.
6+
- name: Case 1, infant at nutritional risk (draw=0, INFANT rate=0.95).
67
period: 2024-01
78
input:
89
age: 0
910
output:
1011
is_wic_at_nutritional_risk: true
1112

12-
- name: Case 2, child assumed at nutritional risk in individual simulation.
13+
- name: Case 2, child at nutritional risk (draw=0, CHILD rate=0.752).
1314
period: 2024-01
1415
input:
1516
age: 3
1617
output:
1718
is_wic_at_nutritional_risk: true
1819

19-
- name: Case 3, adult assumed at nutritional risk in individual simulation.
20+
- name: Case 3, non-WIC adult not at nutritional risk (NONE rate=0).
2021
period: 2024-01
2122
input:
2223
age: 35
2324
output:
24-
# Even adults are assumed at nutritional risk in individual simulation.
25-
# Demographic eligibility is checked separately in is_wic_eligible.
26-
is_wic_at_nutritional_risk: true
25+
is_wic_at_nutritional_risk: false
2726

2827
- name: Case 4, person receiving WIC is at nutritional risk.
2928
period: 2024-01

policyengine_us/tests/policy/baseline/gov/usda/wic/wic.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
input:
44
wic_category_str: PREGNANT
55
is_wic_eligible: true
6+
would_claim_wic: true
67
output:
78
wic: 37.33
89

@@ -12,29 +13,31 @@
1213
wic_category_str: INFANT
1314
is_wic_eligible: false
1415
output:
15-
wic: 0
16+
wic: 0
1617

1718
- name: Households that are in postpartum category are eligible.
1819
period: 2018-01
1920
input:
2021
wic_category_str: POSTPARTUM
2122
is_wic_eligible: true
23+
would_claim_wic: true
2224
output:
23-
wic: 30.72
25+
wic: 30.72
2426

2527
- name: Meets eligible test but not one of the WIC demographic categories.
2628
period: 2022-01
2729
input:
2830
wic_category_str: NONE
2931
is_wic_eligible: true
3032
output:
31-
wic: 0
33+
wic: 0
3234

3335
- name: Eligible breastfeeding individuals. Verifies uprating.
3436
period: 2022-01
3537
input:
3638
wic_category_str: BREASTFEEDING
3739
is_wic_eligible: true
40+
would_claim_wic: true
3841
output:
3942
# Multiply by ratio of 2022-01 to 2018-01 CPI-U.
4043
wic: 37.76 * 281.148 / 247.867

policyengine_us/variables/gov/aca/aca_take_up_seed.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)