vignettes/tests/test_alpha2crit.Rmd
test_alpha2crit.Rmd
test_that("z two-tailed vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ) ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ) ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ) ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ) ), digits = 3 ), round( c( -3.290527, -2.575829, -1.959964, 1.959964, 2.575829, 3.290527 ), digits = 3 ) ) })
test_that("z two-tailed single value", { expect_equivalent( round( alpha2crit( alpha = 0.05 ), digits = 3 ), round( ci2crit( ci = 0.95 ), digits = 3 ), round( c( -1.959964, 1.959964 ), digits = 3 ) ) })
test_that("t two-tailed vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), dist = "t", df = 1000 ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), dist = "t", df = 1000 ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "t", df = 1000 ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), dist = "t", df = 1000 ), digits = 3 ), round( c( -3.290527, -2.575829, -1.959964, 1.959964, 2.575829, 3.290527 ), digits = 3 ) ) })
test_that("t two-tailed single value", { expect_equivalent( round( alpha2crit( alpha = 0.05, dist = "t", df = 1000 ), digits = 3 ), round( ci2crit( ci = 0.95, dist = "t", df = 1000 ), digits = 3 ), round( c( -1.959964, 1.959964 ), digits = 3 ) ) })
test_that("z one-tailed right vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), two.tailed = FALSE ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), two.tailed = FALSE ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), two.tailed = FALSE ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), two.tailed = FALSE ), digits = 3 ), round( c( 1.644854, 2.326348, 3.090232 ), digits = 3 ) ) })
test_that("z one-tailed right single value", { expect_equivalent( round( alpha2crit( alpha = 0.05, two.tailed = FALSE ), digits = 3 ), round( ci2crit( ci = 0.95, two.tailed = FALSE ), digits = 3 ), round( 1.644854, digits = 3 ) ) })
test_that("t one-tailed right vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), dist = "t", two.tailed = FALSE, df = 1000 ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), dist = "t", two.tailed = FALSE, df = 1000 ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "t", two.tailed = FALSE, df = 1000 ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), dist = "t", two.tailed = FALSE, df = 1000 ), digits = 3 ), round( c( 1.644854, 2.326348, 3.090232 ), digits = 3 ) ) })
test_that("t one-tailed right single value", { expect_equivalent( round( alpha2crit( alpha = 0.05, dist = "t", two.tailed = FALSE, df = 1000 ), digits = 3 ), round( ci2crit( ci = 0.95, dist = "t", two.tailed = FALSE, df = 1000 ), digits = 3 ), round( 1.644854, digits = 3 ) ) })
test_that("z one-tailed left vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), two.tailed = FALSE, right.tail = FALSE ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), two.tailed = FALSE, right.tail = FALSE ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), two.tailed = FALSE, right.tail = FALSE ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), two.tailed = FALSE, right.tail = FALSE ), digits = 3 ), round( c( -3.090232, -2.326348, -1.644854 ), digits = 3 ) ) })
test_that("z one-tailed left single value", { expect_equivalent( round( alpha2crit( alpha = 0.05, two.tailed = FALSE, right.tail = FALSE ), digits = 3 ), round( ci2crit( ci = 0.95, two.tailed = FALSE, right.tail = FALSE ), digits = 3 ), round( -1.644854, digits = 3 ) ) })
test_that("t one-tailed left vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 1000 ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 1000 ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 1000 ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 1000 ), digits = 3 ), round( c( -3.090232, -2.326348, -1.644854 ), digits = 3 ) ) })
test_that("t one-tailed left single value", { expect_equivalent( round( alpha2crit( alpha = 0.05, dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 1000 ), digits = 3 ), round( ci2crit( ci = 0.95, dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 1000 ), digits = 3 ), round( -1.644854, digits = 3 ) ) })
test_that("F one-tailed right vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), dist = "F", df1 = 2, df2 = 2 ), digits = 0 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), dist = "F", df1 = 2, df2 = 2 ), digits = 0 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "F", df1 = 2, df2 = 2 ), digits = 0 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), dist = "F", df1 = 2, df2 = 2 ), digits = 0 ), round( c( 19, 99, 999 ), digits = 0 ) ) })
test_that("chisq one-tailed right vector", { expect_equivalent( round( alpha2crit( alpha = c( 0.001, 0.01, 0.05 ), dist = "chisq", df = 1 ), digits = 3 ), round( alpha2crit( alpha = c( 0.05, 0.01, 0.001 ), dist = "chisq", df = 1 ), digits = 3 ), round( ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "chisq", df = 2 ), digits = 3 ), round( ci2crit( ci = c( 0.95, 0.99, 0.999 ), dist = "chisq", df = 2 ), digits = 3 ), round( c( 3.841459, 6.634897, 10.827566 ), digits = 3 ) ) })