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

glm.cmp would give an error if the model matrix doesn't have full rank #9

Open
thomas-fung opened this issue Oct 30, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@thomas-fung
Copy link
Owner

library(tidyverse)
library(mpcmp)
dat <- tribble(~count, ~ code1, ~code2,
               3, "Code 1", "Code 1",
               4, "Code 2", "Code 1",
               2, "Code 2", "Code 1",
               5, "Code 2", "Code 2",
               1, "Code 2", "Code 2")
M1 <- glm(formula=count ~ code1 * code2, data = dat, family = poisson)
coef(M1)
#>             (Intercept)             code1Code 2             code2Code 2 
#>            1.098612e+00           -2.167798e-16            5.768888e-16 
#> code1Code 2:code2Code 2 
#>                      NA
M2 <- glm.cmp(formula=count ~ code1 * code2, data = dat)
#> Error in if (update_info_matrix < 0) {: missing value where TRUE/FALSE needed

Created on 2020-10-30 by the reprex package (v0.3.0)

Need to update the main fitting function to make it behave more like the glm function.

@thomas-fung thomas-fung added the bug Something isn't working label Oct 30, 2020
@thomas-fung thomas-fung self-assigned this Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant