Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

summary.manyglm fails if family is "binomial(link=logit)" #20

Closed
raymondben opened this issue Mar 18, 2016 · 4 comments
Closed

summary.manyglm fails if family is "binomial(link=logit)" #20

raymondben opened this issue Mar 18, 2016 · 4 comments

Comments

@raymondben
Copy link

Fails:
[from the demo code]

glm.spid.bin <- manyglm(pres.abs~soil.dry+bare.sand+moss, data=X, family="binomial")
summary(glm.spid.bin)

Error in summary.manyglm(glm.spid.bin) :
'family' not defined. Choose one of 'poisson', 'negative.binomial', 'binomial' for an manyglm object

The family is:

glm.spid.bin$family
[1] "binomial(link=logit)"

But summary.manyglm looks for an exact string match on the family (object$family == "binomial"), so it fails. Probably this test should be more like the one used in anova.manyglm (substr(object$family, 1, 1) == "b")

sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mvabund_3.11.5

@aliceyiwang
Copy link
Collaborator

Hi, Ben,

I don't get the error in summary.manyglm(glm.spid.bin) by running the
example. I'm not sure which version you are looking at, but the line
(substr(object$family,
1, 1) == "b") is not in anova.manyglm() on GitHub. In fact, the substring
function is used only in manyglm() to parse the input argument 'family' to
object$family. Both summary and anova functions inherit the object's family
class from object$family. Therefore, unless the attribute is manually
altered, you should not get the error with summary.manyglm or
anova.manyglm. Please let me know if there are still problems.

Alice

On Fri, Mar 18, 2016 at 10:33 AM, Ben Raymond notifications@github.com
wrote:

Fails:
[from the demo code]
glm.spid.bin <- manyglm(pres.abs~soil.dry+bare.sand+moss, data=X,
family="binomial")
summary(glm.spid.bin)

Error in summary.manyglm(glm.spid.bin) :
'family' not defined. Choose one of 'poisson', 'negative.binomial',
'binomial' for an manyglm object

The family is:

glm.spid.bin$family
[1] "binomial(link=logit)"

But summary.manyglm looks for an exact string match on the family
(object$family == "binomial"), so it fails. Probably this test should be
more like the one used in anova.manyglm (substr(object$family, 1, 1) == "b")

sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] mvabund_3.11.5


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#20

@raymondben
Copy link
Author

We were using the CRAN version (3.11.5, see my sessionInfo output above). You're right, the current dev version (3.11.7) doesn't have this problem. Sorry, didn't check that before submitting. Thanks.

@eddelbuettel
Copy link
Collaborator

Thanks for the follow-up. Maybe time for Alice to roll up a new version...

@aliceyiwang
Copy link
Collaborator

David,

Maybe it is time to update the CRAN version?

Thanks,
Alice

On Mon, Mar 21, 2016 at 5:59 AM, Dirk Eddelbuettel <notifications@github.com

wrote:

Thanks for the follow-up. Maybe time for Alice to roll up a new version...


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#20 (comment)

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

No branches or pull requests

3 participants