Variable importance for weighted models.
bug
First, thanks for the package.
When attempting to use `importance` with weighted glms, I get an error claiming an "Unexpected Internal error". A MWE:
```
glm1 <- glm(vs ~ disp, data = mtcars, family = binomial(link = "logit"), weights=mtcars$gear)
glm0 <- glm(vs ~ 1, data = mtcars, family = binomial(link = "logit"), weights=mtcars$gear)
imp <- tornado::importance(glm1, glm0)
```
Looking in the debugging trace, it seems the problem is in `.create_tab_summary`, where `var_final` has value `c("disp", "(weights)")`,
whereas `rownames(model_add1) = c("<none>", "disp")`.
关闭于 2023-02-12 3 条评论