Skip to content

Commit

Permalink
more supported models
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Sep 11, 2023
1 parent b871e06 commit 75e7999
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/sanitize_type.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ sanitize_type <- function(model, type, calling_function = NULL) {
if (calling_function %in% c("slopes", "comparisons")) {
dict <- dict[dict$type != "linkinv(link)", , drop = FALSE]
}

# fixest: linkinv(link) only supported for glm model
if (inherits(model, "fixest")) {
if (!isTRUE(hush(model[["method_type"]]) %in% c("feglm"))) {
dict <- dict[dict$type != "linkinv(link)", , drop = FALSE]
}
}

dict <- dict[dict$class == cl, , drop = FALSE]
checkmate::assert_choice(type, choices = dict$type, null.ok = TRUE)
if (is.null(type)) {
Expand Down
3 changes: 3 additions & 0 deletions R/type_dictionary.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ hxlr,scale
hxlr,density
ivpml,pr
ivpml,xb
fixest,linkinv(link)
fixest,response
fixest,link
hurdle,response
Expand All @@ -59,6 +60,7 @@ iv_robust,response
lm,response
gam,response
gam,link
Gam,linkinv(link)
Gam,response
Gam,link
geeglm,response
Expand Down Expand Up @@ -102,6 +104,7 @@ mhurdle,E
mhurdle,Ep
mhurdle,p
mlogit,response
negbin,linkinv(link)
negbin,response
negbin,link
ols,lp
Expand Down

0 comments on commit 75e7999

Please sign in to comment.