Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in confint.profile.gnm() #10

Closed
dwoll opened this issue Feb 13, 2019 · 1 comment
Closed

Possible bug in confint.profile.gnm() #10

dwoll opened this issue Feb 13, 2019 · 1 comment

Comments

@dwoll
Copy link

dwoll commented Feb 13, 2019

I believe there is a subsetting bug in confint.profile.gnm() which is triggered when there is only 1 covariate. Consider

library(gnm)
d <- as.data.frame(cautres)
fit <- gnm(Freq ~ vote, eliminate=class, family=poisson, data=d)
confint(fit)

For me, this returns an error message which appears to be due to lines 30-31 in file confint.profile.gnm.R:

std.err <- attr(object, "summary")$coefficients[, "Std. Error"]
parm <- parm[!is.na(std.err)[parm]]

After replacing these lines with

std.err <- attr(object, "summary")$coefficients[, "Std. Error", drop=FALSE]
parm <- parm[!is.na(std.err)[parm, ]]

The error disappears.

Many thanks for developing gnm and making it freely available! Conditional Poisson regression is very useful in epidemiology.

@hturner
Copy link
Owner

hturner commented Feb 13, 2019

Thanks for the comprehensive bug report! This should be fixed in the GitHub version ready for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants