Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR takes another shot at a
predict
method for fixed effect models, with the aim of closing #204 and #243.While this implementation solves the issues with
missing
data raised in #204, it does not fix thefe(x1)&x2
interaction case. Instead I've written a rather hacky solution that attempts to detect these cases and error out.The issue I ran into is that once an
fe
term is involved, we can't rely on the StatsModels magic to create ourX
matrix for us and then multiply by coefficients. While it wouldn't be too hard to fix this for the simplefe(x1)&x2
case, I quickly realized that this doesn't then coverfe(x1)&fe(x2)&x3
and lots of other permutations one could think up. All in all I was going down a path of re-implementing themodelmatrix
machinery which didn't seem right, so I stopped and copped out with the error.Would be good to get opinions from @matthieugomez @eloualiche as to whether a band aid like this is acceptable to at least get the basic functionality in, maybe also @jariji who took an interest in #243 in having this. I would also be interested in improving this PR by adding confidence intervals if anyone's got ideas on how to do this.