Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 18, 2024
1 parent adb188f commit 7eb288b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.12.0.3
Version: 0.12.0.4
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
approximation method for the distribution-specific (residual) variance. See
Nakagawa et al. 2017 for details.

* `icc()` and `r2_nakagawa()` get a `model_component` argument indicating the
component for zero-inflation or hurdle models.

# performance 0.12.0

## Breaking
Expand Down
6 changes: 5 additions & 1 deletion R/icc.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ icc <- function(model,
ci_method = NULL,
null_model = NULL,
approximation = "lognormal",
model_component = NULL,
verbose = TRUE,
...) {
# special handling for smicd::semLme()
Expand Down Expand Up @@ -210,7 +211,8 @@ icc <- function(model,
model,
tolerance = tolerance,
null_model = null_model,
approximation = approximation
approximation = approximation,
model_component = model_component
)

# return if ICC couldn't be computed
Expand Down Expand Up @@ -545,6 +547,7 @@ print.icc_decomposed <- function(x, digits = 2, ...) {
name_fun = "icc()",
name_full = "ICC",
null_model = NULL,
model_component = NULL,
approximation = "lognormal",
verbose = TRUE) {
vars <- tryCatch(
Expand All @@ -554,6 +557,7 @@ print.icc_decomposed <- function(x, digits = 2, ...) {
tolerance = tolerance,
null_model = null_model,
approximation = approximation,
model_component = model_component,
verbose = verbose
),
error = function(e) {
Expand Down
4 changes: 3 additions & 1 deletion R/r2_nakagawa.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ r2_nakagawa <- function(model,
ci_method = NULL,
null_model = NULL,
approximation = "lognormal",
model_component = NULL,
verbose = TRUE,
...) {
# calculate random effect variances
Expand All @@ -95,7 +96,8 @@ r2_nakagawa <- function(model,
null_model = null_model,
approximation = approximation,
name_fun = "r2()",
name_full = "r-squared"
name_full = "r-squared",
model_component = model_component
)

# return if R2 couldn't be computed
Expand Down
6 changes: 6 additions & 0 deletions man/icc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/r2_nakagawa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7eb288b

Please sign in to comment.