Closed shah-in-boots closed 3 years ago
Sorry for the delay. It looks great. One request, please add gee
to Suggests
.
Also, yes, an engine for Poisson models would be better in poissonreg
. That shouldn't be too bad since gee_fit()
is exported here.
(For posterity) There are some significant differences in how gee()
operates and most other modeling functions, especially glm()
. None of these are documented in ?gee
:
gee()
inherits from glm
so, theoretically, predict()
should work. It does not since there are no rank
or qr
elements to gee
objects. These are required by predict.lm()
, which is called by predict.glm()
. This is ironic since gee()
does an initial glm()
computation up-front for starting values and these are not attached. To solve this, gee_fit()
computes another glm()
fit and adds the needed objects. Even though predict.glm()
calls predict.lm()
, it will issue a warning "calling predict.lm(<fake-lm-object>) ..."
. We subclass the model fit with lm
to avoid this.
gee()
requires 0/1 data (as opposed to a factor). We do the conversion in gee_fit()
now. The GH actions failures are due to the nloptr
package failing to build from source. I'll merge.
Thanks for the help @asshah4. If you add another PR to poissonreg
, it should be pretty similar to the linear regression work here.
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
This should allow for linear and logistic models to be run using the original
gee::gee()
function. I've added appropriate tests as well.I haven't yet put together poisson, but wanted to see if this seemed like a reasonable addition thus far. Also, not sure if
poissonreg
would be a better home for that. When we're discussion models based on distribution, they really start melting together at the edges.