Skip to content

Fix pencon#71

Open
MarionetteSHF wants to merge 4 commits intomasterfrom
def_tax_unit
Open

Fix pencon#71
MarionetteSHF wants to merge 4 commits intomasterfrom
def_tax_unit

Conversation

@MarionetteSHF
Copy link

define tax_unit function to add tax_unit to CPS. But I do not know how to match variables. For example, which column of tax_unit is corresponding to "e00200p"

@MaxGhenis
Copy link
Contributor

@andersonfrailey could you point us to the CPS variable renames in taxdata? I tried searching for e00200 and looking through scripts in taxdata/cps but couldn't find how that's created.

@MarionetteSHF FYI we don't need any of the variables ending in p and s, like e00200p and e00200s. These indicate values for the primary and spouse, which we're creating instead at the person level and then summing to tax-unit-level characteristics in openfisca-us itself. (@nikhilwoodruff correct me if I'm wrong here.)

@andersonfrailey
Copy link

@MaxGhenis, it happens here and here. It's not explicit on those lines, but there's a variable called INCOME_TUPLES that maps the variable name in the CPS to the taxcalc variable name

### ACS
- OpenFisca-US-compatible
- Contains OpenFisca-US-compatible input arrays.
### hello world hello No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### hello world hello

Copy link
Contributor

@nikhilwoodruff nikhilwoodruff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly there!

add_personal_income_variables(cps, person)
add_SPM_variables(cps, spm_unit)

add_tax_unit_variables(cps, tax_unit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
add_tax_unit_variables(cps, tax_unit)

cps[openfisca_variable] = spm_unit[asec_variable]


def add_tax_unit_variables(cps: h5py.File, tax_unit: DataFrame):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this bit from this PR since it's done in OpenFisca-US.

@MarionetteSHF MarionetteSHF linked an issue Feb 6, 2022 that may be closed by this pull request
@nikhilwoodruff nikhilwoodruff changed the title Def tax unit Fix pencon Feb 6, 2022
@nikhilwoodruff nikhilwoodruff mentioned this pull request Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add individual financial variables

4 participants