Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: How to analyze flattened Policy Engine file versus taxdata #12

Closed
donboyd5 opened this issue Feb 18, 2024 · 7 comments
Closed
Labels
documentation Improvements or additions to documentation

Comments

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 18, 2024

@nikhilwoodruff, @martinholmer

I've started a preliminary ad hoc analysis of the Feb 14 version of the flattened PolicyEngine file, comparing it to the taxdata file grown to 2023, provided by @martinholmer , and to a version of that taxdata file with only the variables that the flattened PolicyEngine file has. The results so far are at this web page. I do not pretend that the taxdata file is truth. Still, there are some large differences that eventually would be important to understand.

While I don't think there is anything we have to do with the results in Phase 1, there are lessons and perhaps some pointers that might be useful even in Phase 1. I think we should discuss briefly in our next call.

I'll plan to update this with some more tables as time permits, and will rerun when there is a new version of the flattened PolicyEngine file. I do not plan to save analyses of older versions of the file unless you tell me you think it is important.

@nikhilwoodruff
Copy link
Collaborator

Thanks Don- this is really useful! Is the code for this available so I can re-run it more frequently as the data updates?

@nikhilwoodruff nikhilwoodruff added the documentation Improvements or additions to documentation label Feb 20, 2024
@donboyd5
Copy link
Collaborator Author

donboyd5 commented Feb 20, 2024 via email

@nikhilwoodruff
Copy link
Collaborator

OK thanks. Yep, just installed.

@donboyd5
Copy link
Collaborator Author

The repo is here. There is some deadwood in it (copied over from other projects) and it loads far more packages than it actually uses right now (copied over from other projects).

The quarto project that creates the ad hoc web page is in the folder pe_flatfile.

You'll see that it crudely calls tc.exe from R, in Windows. You'll need to adjust that to work on your system.

There is some code you'll have to run onetime - e.g., creating an rds file with tax-calculator documentation for variables - and then you can set eval false for the relevant code chunk.

The _quarto.yml file directs traffic so you should start there. All sorts of stuff commented out to remind me how to do things as I extend the project. Once you have everything set up properly, you should be able to run everything by opening a terminal in pe_flatfile folder and doing "quarto render" or "quarto publish netlify --no-browser --no-prompt" if you have a netlify account.

I put it all together quickly with me as the audience so it is not as clear as it might be. If you have trouble getting it to work, pls let me know.

Don

@donboyd5
Copy link
Collaborator Author

donboyd5 commented Feb 20, 2024

The R project uses my package btools. You can install it or just ignore it.

I think the only things the ad hoc project uses are:

  • the function ht(), which shows the head and tail of a data frame or other object; obviously, there are plenty of workarounds for that
  • the function ns(), which shows the names of an object sorted in alpha order; again, easy workarounds

@donboyd5
Copy link
Collaborator Author

@nikhilwoodruff @martinholmer

I have updated the code to download the latest PE flat file and have run the code on that file. Results are in the same place as before, overwriting the results for the older PE file.

The code is on GitHub and is on the web page as well, folded.

@donboyd5
Copy link
Collaborator Author

Fixed code error as discussed in this PR.

@martinholmer martinholmer changed the title Ad hoc analysis of flattened Policy Engine file versus taxdata Analyze flattened Policy Engine file versus taxdata Sep 1, 2024
@martinholmer martinholmer changed the title Analyze flattened Policy Engine file versus taxdata Discussion: How to analyze flattened Policy Engine file versus taxdata Sep 21, 2024
@PSLmodels PSLmodels locked and limited conversation to collaborators Sep 21, 2024
@martinholmer martinholmer converted this issue into discussion #217 Sep 21, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants