Skip to content

Commit

Permalink
link-inv
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 2, 2025
1 parent bb360bd commit e53f724
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,7 @@ S3method(link_function,mvord)
S3method(link_function,negbinirr)
S3method(link_function,negbinmfx)
S3method(link_function,nestedLogit)
S3method(link_function,oohbchoice)
S3method(link_function,ordinal_weightit)
S3method(link_function,orm)
S3method(link_function,phylolm)
Expand Down Expand Up @@ -1305,6 +1306,7 @@ S3method(link_inverse,mvord)
S3method(link_inverse,negbinirr)
S3method(link_inverse,negbinmfx)
S3method(link_inverse,nestedLogit)
S3method(link_inverse,oohbchoice)
S3method(link_inverse,ordinal_weightit)
S3method(link_inverse,orm)
S3method(link_inverse,phyloglm)
Expand Down
14 changes: 14 additions & 0 deletions R/link_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,20 @@ link_function.Rchoice <- function(x, ...) {
}


#' @export
link_function.oohbchoice <- function(x, ...) {
link <- switch(x$distribution,
normal = "identity",
weibull = ,
"log-normal" = "log",
logistic = ,
## TODO: not sure about log-logistic link-inverse
"log-logistic" = "logit"
)
stats::make.link(link = link)$linkfun
}


#' @export
link_function.merModList <- function(x, ...) {
link_function.default(x[[1]], ...)
Expand Down
14 changes: 14 additions & 0 deletions R/link_inverse.R
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,20 @@ link_inverse.Rchoice <- function(x, ...) {
}


#' @export
link_inverse.oohbchoice <- function(x, ...) {
link <- switch(x$distribution,
normal = "identity",
weibull = ,
"log-normal" = "log",
logistic = ,
## TODO: not sure about log-logistic link-inverse
"log-logistic" = "logit"
)
stats::make.link(link = link)$linkinv
}


#' @export
link_inverse.merModList <- function(x, ...) {
link_inverse.default(x[[1]], ...)
Expand Down

0 comments on commit e53f724

Please sign in to comment.