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

Improve support for rqs #839

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: insight
Title: Easy Access to Model Information for Various Model Objects
Version: 0.19.7.5
Version: 0.19.7.6
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ S3method(find_algorithm,mixed)
S3method(find_algorithm,nestedLogit)
S3method(find_algorithm,rlmerMod)
S3method(find_algorithm,rq)
S3method(find_algorithm,rqs)
S3method(find_algorithm,rqss)
S3method(find_algorithm,scam)
S3method(find_algorithm,speedglm)
Expand Down Expand Up @@ -1118,6 +1119,7 @@ S3method(link_function,psm)
S3method(link_function,riskRegression)
S3method(link_function,robmixglm)
S3method(link_function,rq)
S3method(link_function,rqs)
S3method(link_function,rqss)
S3method(link_function,speedglm)
S3method(link_function,speedlm)
Expand Down Expand Up @@ -1241,6 +1243,7 @@ S3method(link_inverse,psm)
S3method(link_inverse,riskRegression)
S3method(link_inverse,robmixglm)
S3method(link_inverse,rq)
S3method(link_inverse,rqs)
S3method(link_inverse,rqss)
S3method(link_inverse,speedglm)
S3method(link_inverse,speedlm)
Expand Down Expand Up @@ -1389,6 +1392,7 @@ S3method(model_info,riskRegression)
S3method(model_info,rma)
S3method(model_info,robmixglm)
S3method(model_info,rq)
S3method(model_info,rqs)
S3method(model_info,rqss)
S3method(model_info,speedglm)
S3method(model_info,speedlm)
Expand Down Expand Up @@ -1500,6 +1504,7 @@ S3method(n_obs,poissonmfx)
S3method(n_obs,probitmfx)
S3method(n_obs,riskRegression)
S3method(n_obs,rq)
S3method(n_obs,rqs)
S3method(n_obs,rqss)
S3method(n_obs,selection)
S3method(n_obs,sem)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Removed deprecated arguments in `get_data.mmrm()`.

* Improved support for models of class `rqs` (package *quantreg*).

## Bug fixes

* Fixed issue in `get_loglikelihood()` for glm-models with binary outcome, where
Expand Down
12 changes: 6 additions & 6 deletions R/find_algorithm.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ find_algorithm.rq <- function(x, ...) {
list(algorithm = x$method)
}

#' @export
find_algorithm.rqs <- find_algorithm.rq

#' @export
find_algorithm.rqss <- find_algorithm.rq


#' @export
find_algorithm.bayesx <- function(x, ...) {
Expand All @@ -209,12 +215,6 @@ find_algorithm.crq <- function(x, ...) {
}


#' @export
find_algorithm.rqss <- function(x, ...) {
list(algorithm = x$method)
}


#' @export
find_algorithm.glm <- function(x, ...) {
list(algorithm = "ML")
Expand Down
3 changes: 3 additions & 0 deletions R/link_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
#' @export
link_function.rq <- link_function.lm

#' @export
link_function.rqs <- link_function.lm

#' @export
link_function.rqss <- link_function.lm

Expand Down Expand Up @@ -758,7 +761,7 @@
if (!is.null(fam$family) && (is.character(fam$family) && fam$family == "custom")) {
il <- stats::make.link(fam$link)$linkfun
} else {
if ("linkfun" %in% names(fam)) {

Check warning on line 764 in R/link_function.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/link_function.R,line=764,col=5,[unnecessary_nesting_linter] Simplify this condition by using 'else if' instead of 'else { if.
il <- fam$linkfun
} else if ("link" %in% names(fam) && is.character(fam$link)) {
il <- stats::make.link(fam$link)$linkfun
Expand Down
3 changes: 3 additions & 0 deletions R/link_inverse.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
#' @export
link_inverse.rq <- link_inverse.lm

#' @export
link_inverse.rqs <- link_inverse.lm

#' @export
link_inverse.rqss <- link_inverse.lm

Expand Down Expand Up @@ -724,7 +727,7 @@
if (!is.null(fam$family) && (is.character(fam$family) && fam$family == "custom")) {
il <- stats::make.link(fam$link)$linkinv
} else {
if ("linkinv" %in% names(fam)) {

Check warning on line 730 in R/link_inverse.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/link_inverse.R,line=730,col=5,[unnecessary_nesting_linter] Simplify this condition by using 'else if' instead of 'else { if.
il <- fam$linkinv
} else if ("link" %in% names(fam) && is.character(fam$link)) {
il <- stats::make.link(fam$link)$linkinv
Expand Down
3 changes: 3 additions & 0 deletions R/model_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ model_info.bayesx <- model_info.maxLik
#' @export
model_info.rq <- model_info.maxLik

#' @export
model_info.rqs <- model_info.maxLik

#' @export
model_info.crq <- model_info.maxLik

Expand Down
Loading
Loading