Closed nilshg closed 10 months ago
All modified lines are covered by tests :white_check_mark:
Comparison is base (
6d23721
) 95.78% compared to head (d0ad15b
) 96.35%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Yes, I think a band aid like this is acceptable.
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.