Skip to content

Commit 6ac3ee5

Browse files
authored
check_heterogeneity_bias() -> check_group_variation()
2 parents dc931f4 + c70d3d0 commit 6ac3ee5

File tree

8 files changed

+10
-8
lines changed

8 files changed

+10
-8
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Suggests:
183183
panelr,
184184
pbkrtest,
185185
PCDimension,
186-
performance (>= 0.12.0),
186+
performance (>= 0.14.0),
187187
plm,
188188
PMCMRplus,
189189
poorman,

R/1_model_parameters.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
#'
130130
#' - **pseudo** (*for 2-level (G)LMMs only*): In this (post-hoc) method, the
131131
#' response and the predictor are standardized based on the level of prediction
132-
#' (levels are detected with [performance::check_heterogeneity_bias()]): Predictors
132+
#' (levels are detected with [performance::check_group_variation()]): Predictors
133133
#' are standardized based on their SD at level of prediction (see also
134134
#' [datawizard::demean()]); The outcome (in linear LMMs) is standardized based
135135
#' on a fitted random-intercept-model, where `sqrt(random-intercept-variance)`

R/standardize_info.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ standardize_info.default <- function(model,
415415

416416
f <- if (two_sd) 2 else 1
417417

418-
within_vars <- unclass(performance::check_heterogeneity_bias(model))
418+
gv <- performance::check_group_variation(model)
419+
within_vars <- gv[gv$Variation %in% c("both", "within"), "Variable"]
419420
id <- insight::get_random(model)[[1]]
420421
w <- insight::get_weights(model, remove_na = TRUE)
421422

R/standardize_parameters.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
#' delta.
6565
#' - **pseudo** (*for 2-level (G)LMMs only*): In this (post-hoc) method, the
6666
#' response and the predictor are standardized based on the level of prediction
67-
#' (levels are detected with [`performance::check_heterogeneity_bias()`]): Predictors
67+
#' (levels are detected with [`performance::check_group_variation()`]): Predictors
6868
#' are standardized based on their SD at level of prediction (see also
6969
#' [`datawizard::demean()`]); The outcome (in linear LMMs) is standardized based
7070
#' on a fitted random-intercept-model, where `sqrt(random-intercept-variance)`

man/model_parameters.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/standardize_parameters.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-standardize_parameters.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ test_that("standardize_parameters (Bayes)", {
329329
# Pseudo - GLMM --------------------------------
330330
test_that("standardize_parameters (Pseudo - GLMM)", {
331331
skip_if_not_installed("datawizard", minimum_version = "0.12.0")
332+
skip_if_not_installed("performance", minimum_version = "0.14.0")
332333
skip_on_cran()
333334
skip_if_not_installed("lme4")
334335
set.seed(1)

vignettes/demean.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ turn, results in biased estimates, because both the within- *and* between-effect
8585
are captured in *one* estimate.
8686

8787
You can check if your model may suffer from heterogeneity bias using the
88-
`check_heterogeneity_bias()` function:
88+
`check_group_variation()` function:
8989

9090
```{r}
9191
library(performance)
92-
check_heterogeneity_bias(qol_cancer, select = c("phq4", "education"), by = "ID")
92+
check_group_variation(qol_cancer, select = c("phq4", "education"), by = "ID")
9393
```
9494

9595
# Adressing heterogeneity bias: the Fixed Effects Regression (FE) approach

0 commit comments

Comments
 (0)