Skip to content

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

@thomas-fung

Description

@thomas-fung
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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions