From 5d85645a76359c4b7755700926821484cf115fa8 Mon Sep 17 00:00:00 2001 From: Jeff Eaton Date: Tue, 27 Sep 2022 17:48:06 +0100 Subject: [PATCH] patch geeglm() error when starting values specified --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/geeglm.R | 12 +++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 55c1e1a..4ae4e80 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: geepack -Version: 1.3.9 +Version: 1.3.10 Title: Generalized Estimating Equation Package Authors@R: c( person(given = "Søren", family = "Højsgaard", diff --git a/NEWS.md b/NEWS.md index 81b6e13..1ef655a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# geepack v1.3.10 (2022-09-27) + + * Patch `geeglm()` error when specifying starting values (issue #5). + # geepack v1.3.9 (2022-08-16) * QIC now takes environment argument because the function is called from another function in another package. diff --git a/R/geeglm.R b/R/geeglm.R index 836aeea..04a35cd 100755 --- a/R/geeglm.R +++ b/R/geeglm.R @@ -164,7 +164,8 @@ geeglm<- function (formula, family = gaussian, data = parent.frame(), mf[[1]] <- as.name("model.frame") mftmp <- mf - to_delete <- c("family", "corstr", "control", "zcor", "std.err", "scale.fix") + to_delete <- c("family", "corstr", "control", "zcor", "std.err", "scale.fix", + "start", "etastart", "mustart") mftmp[match(to_delete, names(mftmp))] <- NULL ## mftmp$family <- mftmp$corstr <- mftmp$control <- mftmp$zcor <- mftmp$std.err <- NULL @@ -249,9 +250,14 @@ geeglm<- function (formula, family = gaussian, data = parent.frame(), xx <- as.data.frame(xx) xx[, nacoef] <- NULL xx <- as.matrix(xx) + + ## @jeffeaton 2022-09-27: I am not sure if this if(is.null(start)) is desireable. + ## The specified starting values will be used in the initial glm() fit to create + ## glmFit. But here it seems better to use the glmFit coefficients. + ## + ## if (is.null(start)) - if (is.null(start)) - start <- glmFit$coef + start <- glmFit$coef ans <- geese.fit(xx, yy, id, offset, soffset, w, waves = waves, zsca, zcor = zcor, corp = NULL, control = control, b = start,