diff --git a/DESCRIPTION b/DESCRIPTION index 0fe42daee..be27f7c8a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -183,7 +183,7 @@ Suggests: panelr, pbkrtest, PCDimension, - performance (>= 0.12.0), + performance (>= 0.14.0), plm, PMCMRplus, poorman, diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index d19f6c6ce..ec3760895 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -129,7 +129,7 @@ #' #' - **pseudo** (*for 2-level (G)LMMs only*): In this (post-hoc) method, the #' response and the predictor are standardized based on the level of prediction -#' (levels are detected with [performance::check_heterogeneity_bias()]): Predictors +#' (levels are detected with [performance::check_group_variation()]): Predictors #' are standardized based on their SD at level of prediction (see also #' [datawizard::demean()]); The outcome (in linear LMMs) is standardized based #' on a fitted random-intercept-model, where `sqrt(random-intercept-variance)` diff --git a/R/standardize_info.R b/R/standardize_info.R index 1c067e2cd..a7cc7c612 100644 --- a/R/standardize_info.R +++ b/R/standardize_info.R @@ -415,7 +415,8 @@ standardize_info.default <- function(model, f <- if (two_sd) 2 else 1 - within_vars <- unclass(performance::check_heterogeneity_bias(model)) + gv <- performance::check_group_variation(model) + within_vars <- gv[gv$Variation %in% c("both", "within"), "Variable"] id <- insight::get_random(model)[[1]] w <- insight::get_weights(model, remove_na = TRUE) diff --git a/R/standardize_parameters.R b/R/standardize_parameters.R index ef4c91a8c..8e8bcf2fd 100644 --- a/R/standardize_parameters.R +++ b/R/standardize_parameters.R @@ -64,7 +64,7 @@ #' delta. #' - **pseudo** (*for 2-level (G)LMMs only*): In this (post-hoc) method, the #' response and the predictor are standardized based on the level of prediction -#' (levels are detected with [`performance::check_heterogeneity_bias()`]): Predictors +#' (levels are detected with [`performance::check_group_variation()`]): Predictors #' are standardized based on their SD at level of prediction (see also #' [`datawizard::demean()`]); The outcome (in linear LMMs) is standardized based #' on a fitted random-intercept-model, where `sqrt(random-intercept-variance)` diff --git a/man/model_parameters.Rd b/man/model_parameters.Rd index 628bfee85..553796137 100644 --- a/man/model_parameters.Rd +++ b/man/model_parameters.Rd @@ -142,7 +142,7 @@ As a results, the coefficients for effects of factors are similar to a Glass' delta. \item \strong{pseudo} (\emph{for 2-level (G)LMMs only}): In this (post-hoc) method, the response and the predictor are standardized based on the level of prediction -(levels are detected with \code{\link[performance:check_heterogeneity_bias]{performance::check_heterogeneity_bias()}}): Predictors +(levels are detected with \code{\link[performance:check_group_variation]{performance::check_group_variation()}}): Predictors are standardized based on their SD at level of prediction (see also \code{\link[datawizard:demean]{datawizard::demean()}}); The outcome (in linear LMMs) is standardized based on a fitted random-intercept-model, where \code{sqrt(random-intercept-variance)} diff --git a/man/standardize_parameters.Rd b/man/standardize_parameters.Rd index db5c3945a..82cd6c2c5 100644 --- a/man/standardize_parameters.Rd +++ b/man/standardize_parameters.Rd @@ -119,7 +119,7 @@ As a results, the coefficients for effects of factors are similar to a Glass' delta. \item \strong{pseudo} (\emph{for 2-level (G)LMMs only}): In this (post-hoc) method, the response and the predictor are standardized based on the level of prediction -(levels are detected with \code{\link[performance:check_heterogeneity_bias]{performance::check_heterogeneity_bias()}}): Predictors +(levels are detected with \code{\link[performance:check_group_variation]{performance::check_group_variation()}}): Predictors are standardized based on their SD at level of prediction (see also \code{\link[datawizard:demean]{datawizard::demean()}}); The outcome (in linear LMMs) is standardized based on a fitted random-intercept-model, where \code{sqrt(random-intercept-variance)} diff --git a/tests/testthat/test-standardize_parameters.R b/tests/testthat/test-standardize_parameters.R index c3dbeeb73..639a15d05 100644 --- a/tests/testthat/test-standardize_parameters.R +++ b/tests/testthat/test-standardize_parameters.R @@ -329,6 +329,7 @@ test_that("standardize_parameters (Bayes)", { # Pseudo - GLMM -------------------------------- test_that("standardize_parameters (Pseudo - GLMM)", { skip_if_not_installed("datawizard", minimum_version = "0.12.0") + skip_if_not_installed("performance", minimum_version = "0.14.0") skip_on_cran() skip_if_not_installed("lme4") set.seed(1) diff --git a/vignettes/demean.Rmd b/vignettes/demean.Rmd index 27f31725e..14e884d1e 100644 --- a/vignettes/demean.Rmd +++ b/vignettes/demean.Rmd @@ -85,11 +85,11 @@ turn, results in biased estimates, because both the within- *and* between-effect are captured in *one* estimate. You can check if your model may suffer from heterogeneity bias using the -`check_heterogeneity_bias()` function: +`check_group_variation()` function: ```{r} library(performance) -check_heterogeneity_bias(qol_cancer, select = c("phq4", "education"), by = "ID") +check_group_variation(qol_cancer, select = c("phq4", "education"), by = "ID") ``` # Adressing heterogeneity bias: the Fixed Effects Regression (FE) approach