Calculates the \(z\), \(t\), \(\chi^2\), or \(F\) critical value/s of confidence limits associated with the specified confidence interval/s.

ci2crit(
  ci = c(0.999, 0.99, 0.95),
  dist = "z",
  two.tailed = TRUE,
  right.tail = TRUE,
  ...
)

Arguments

ci

Numeric vector. Confidence interval. By default, ci is set to conventional confidence intervals ci = c(0.999, 0.99, 0.95).

dist

Character string. dist = "z" for the standard normal distribution. dist = "t" for the t distribution. dist = "F" for the F distribution. dist = "chisq" for the chi-square distribution.

two.tailed

Logical. If TRUE, two-tailed alpha. If FALSE, one-tailed alpha. Ignored if dist = "F" or dist = "chisq" as both tests are one-tailed using the right tail.

right.tail

Logical. If TRUE, right tail (positive critical value). If FALSE, left tail (negative critical value). Ignored if two.tailed = TRUE. Ignored if dist = "F" or dist = "chisq" as both tests are one-tailed using the right tail.

...

Degrees of freedom. df for dist = "t" and dist = "chisq". df1 and df2 for dist = "F".

Value

Returns \(z\), \(t\), \(\chi^2\), or \(F\) critical value/s associated with the specified confidence interval/s. The results are sorted from smallest to largest.

References

Wikipedia: Statistical significance

Wikipedia: Confidence interval

See also

Other alpha functions: alpha2crit(), alpha2prob(), ci2prob(), nhstplot()

Examples

# z two-tailed ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), )
#> [1] -3.290527 -2.575829 -1.959964 1.959964 2.575829 3.290527
## single numeric value ci2crit(ci = 0.95)
#> [1] -1.959964 1.959964
# t two-tailed ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "t", df = 1000 )
#> [1] -3.300283 -2.580755 -1.962339 1.962339 2.580755 3.300283
## single numeric value ci2crit( ci = 0.95, dist = "t", df = 1000 )
#> [1] -1.962339 1.962339
# z one-tailed right ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "z", two.tailed = FALSE )
#> [1] 3.090232 2.326348 1.644854
# t one-tailed right ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "t", two.tailed = FALSE, df = 5 )
#> [1] 5.893430 3.364930 2.015048
# F one-tailed ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "F", two.tailed = FALSE, df1 = 2, df2 = 2 )
#> [1] 19 99 999
# chisq one-tailed ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "chisq", two.tailed = FALSE, df = 1 )
#> [1] 3.841459 6.634897 10.827566
# z one-tailed left ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "z", two.tailed = FALSE, right.tail = FALSE )
#> [1] -3.090232 -2.326348 -1.644854
# t one-tailed left ## vector ci2crit( ci = c( 0.999, 0.99, 0.95 ), dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 5 )
#> [1] -5.893430 -3.364930 -2.015048