tests/testthat/test-test_r.R

test_that("test_r", {
  r <- runif(1)
  out <- test_r(r, 100)
  expect_lt(
    abs(out$t_test["p_r"] - out$Fisher_z["p_fz"]), 0.002)

  p_r <- out$t_test["p_r"]
  p <- power_lm(r^2, n = 100)$F_test["p"]
  expect_equal(p_r, p, ignore_attr = TRUE)
})

Try the Keng package in your browser

Any scripts or data that you put into this service are public.

Keng documentation built on April 4, 2025, 1:37 a.m.