Skip to content
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

Replace magic-g in g-formula implementations #63

Open
2 tasks
pzivich opened this issue Jan 15, 2019 · 1 comment
Open
2 tasks

Replace magic-g in g-formula implementations #63

pzivich opened this issue Jan 15, 2019 · 1 comment
Labels
Causal inference Updates for the causal inference branch change Docs Updates to the docs / print functions enhancement

Comments

@pzivich
Copy link
Owner

pzivich commented Jan 15, 2019

Both TimeFixedGFormula and TimeVaryGFormula leverage a "magic-g" factor to implement custom treatment plans (i.e. treatments aside from "all" and "none" specifications)

As discussed in #61 it is not readily clear to users that the magic-g factor exists and is necessary. While in the function documentation and on the website, it would be beneficial to be clearer. For now, I am going to attempt to make the documentation clearer. If I find an adequate solution (that works for both implementations), then I will make that transition in the future.

Bandage for Current

  • Make better documentation available on both website and function documentation

  • Create a better warning/error handler for when the magic-g is NOT specified

Requirements

  • Evaluate the data row-by-row

  • Needs to be able to handle multiple conditionals

Alternatives

  • pd.query() looks promising. However, it does not evaluate as I would hope. It returns the df[...] data. What I would like it a vector of 0 and 1 (or others depending on variable type).

  • pd.eval() look it to

@pzivich pzivich mentioned this issue Jan 15, 2019
5 tasks
@pzivich pzivich pinned this issue Jan 15, 2019
@pzivich pzivich mentioned this issue Jan 27, 2019
13 tasks
@pzivich
Copy link
Owner Author

pzivich commented Mar 30, 2019

The magic-g will not be used by IterativeCondGFormula from v0.6.0 onwards. Rather the iterative conditional g-formula takes a list of treatment values. You can also generate a matrix of the treatment plan and pass that to this g-formula.

None of the other g-formula implementations have this type of behavior. I needed to use this since custom treatments are hard to specify otherwise in this g-formula

@pzivich pzivich added Causal inference Updates for the causal inference branch Docs Updates to the docs / print functions labels Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Causal inference Updates for the causal inference branch change Docs Updates to the docs / print functions enhancement
Projects
None yet
Development

No branches or pull requests

1 participant