Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 4, 2023
1 parent 6db5121 commit 393d574
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/test-check_heterogeneity_bias.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ test_that("check_heterogeneity_bias", {
expect_equal(out, c("Sepal.Length", "Petal.Length"), ignore_attr = TRUE)
expect_output(print(out), "Possible heterogeneity bias due to following predictors: Sepal\\.Length, Petal\\.Length")

out <- check_heterogeneity_bias(iris, select = ~ Sepal.Length + Petal.Length, group = ~ID)
expect_equal(out, c("Sepal.Length", "Petal.Length"), ignore_attr = TRUE)
expect_output(print(out), "Possible heterogeneity bias due to following predictors: Sepal\\.Length, Petal\\.Length")

m <- lm(Sepal.Length ~ Petal.Length + Petal.Width + Species + ID, data = iris)
expect_error(
check_heterogeneity_bias(m, select = c("Sepal.Length", "Petal.Length"), group = "ID"),
Expand All @@ -20,4 +24,10 @@ test_that("check_heterogeneity_bias", {
print(out),
"Possible heterogeneity bias due to following predictors: Petal\\.Length, Petal\\.Width, Species"
)
out <- check_heterogeneity_bias(m, select = ~ Sepal.Length + Petal.Length, group = ~ID)
expect_equal(out, c("Petal.Length", "Petal.Width", "Species"), ignore_attr = TRUE)
expect_output(
print(out),
"Possible heterogeneity bias due to following predictors: Petal\\.Length, Petal\\.Width, Species"
)
})

0 comments on commit 393d574

Please sign in to comment.