Skip to content

Commit

Permalink
tests: add vectorized mixed example
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-titz committed Dec 6, 2023
1 parent 29d49e8 commit 9016c36
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/testthat/test-examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,25 @@ test_that("rosenthal 53 works", {
expect_equal(summary(t_53)$Effects[1], 0.871)
}
)

t53_B <- calc_contrast(dv = rosenthal_tbl53$dv,
within = rosenthal_tbl53$within,
between = rosenthal_tbl53$between,
id = rosenthal_tbl53$id,
lambda_within = sample(c(
"a" = -3, "b" = -1,
"c" = 1, "d" = 3
), 4, F),
lambda_between = sample(c(
"age8" = -1, "age10" = 0,
"age12" = 1
), 3, F)
)

test_that("calling vectorized works", {
expect_equal(t_53, t53_B)
})

# Rosenthal chap 5 exercise 2
data(rosenthal_chap5_q2)

Expand Down

0 comments on commit 9016c36

Please sign in to comment.