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

estimate_coefficient method returns different variable types based on if condition #261

Closed
christopher-wild opened this issue Feb 13, 2024 · 8 comments · Fixed by #264
Closed
Assignees

Comments

@christopher-wild
Copy link
Contributor

Describe the bug
The estimate_coefficient method in estimators.py can either return a list of pandas Series or a list of numpy floats based on which if condition is met.

Expected behavior
Ideally only Series would be returned from this method.

Additional context
Unit tests will need fixing as well as they rely on both data types. This change will facilitate the tidying of the method.

@christopher-wild
Copy link
Contributor Author

The other return from the method unit_effect also changes type between Series and numpy float

@jmafoster1
Copy link
Contributor

Please could the return types for the other estimate_* methods be checked too?

@christopher-wild christopher-wild linked a pull request Feb 14, 2024 that will close this issue
@christopher-wild
Copy link
Contributor Author

Would the preference for all estimate_* functions to only return pd.Series for the confidence intervals and the effect?

@jmafoster1
Copy link
Contributor

Yes I think so

@christopher-wild
Copy link
Contributor Author

You okay if we merge #264 as that is meant to be limited to the Pasty interaction terms? Then I'll make a new PR for this issue, and release a version that contains both PRs?

@jmafoster1
Copy link
Contributor

Works for me. Just reviewing the code now

@christopher-wild christopher-wild self-assigned this Feb 14, 2024
@christopher-wild
Copy link
Contributor Author

christopher-wild commented Feb 14, 2024

I may actually hold off on merging this one, if we make all the estimate_* returns consistent, we won't need some of the conditions the #264 PR introduces.

So I'll work on the same branch just to make life simple and not introduce code that we will immediately remove.

@jmafoster1
Copy link
Contributor

Agreed, now I've looked at the chances.
This is a bit unrelated, but if we can get the model from Patsy, we can have it keep track of the adjustment set from the formula as well, which might help with #238

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 a pull request may close this issue.

2 participants