We have not implemented a predict() method for geeglm objects. Since the class inherits from glm, it calls predict.glm(). This works for point estimates, but trying to compute standard errors results in an error. Here is a toy example that invokes the error:
diab <- c("none", "mat", "pat")
d <- data.frame(diab = rep(diab, 50),
lga = sample(c(0,1), 1500, replace = TRUE, prob = c(0.8, 0.2)),
mpnr <- rep(1:750, each = 2))
library(geeasy)
m <- geelm(lga ~ diab, data = d, family = "binomial", id = mpnr,
corstr = "exchangeable")
# Runs with no problems
predict(m, newdata = data.frame(diab = diab))
# Error in scale^2 : non-numeric argument to binary operator
predict(m, newdata = data.frame(diab = diab), se.fit = TRUE)
While we are at it, I think it would be ideal to also implement an option to add (Wald?) confidence intervals to the predictions, similar to predict.lm().
We have not implemented a
predict()
method forgeeglm
objects. Since the class inherits fromglm
, it callspredict.glm()
. This works for point estimates, but trying to compute standard errors results in an error. Here is a toy example that invokes the error: