ci2crit: Confidence Intervals to Critical Values

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/alpha2crit.R

Description

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

Usage

1
2
3
4
5
6
7
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, χ^2, or F critical value/s associated with the specified confidence interval/s. The results are sorted from smallest to largest.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Statistical significance

Wikipedia: Confidence interval

See Also

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

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
# z two-tailed
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
)
## single numeric value
ci2crit(ci = 0.95)
# t two-tailed
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "t",
  df = 1000
)
## single numeric value
ci2crit(
  ci = 0.95,
  dist = "t",
  df = 1000
)
# z one-tailed right
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "z",
  two.tailed = FALSE
)
# t one-tailed right
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "t",
  two.tailed = FALSE,
  df = 5
)
# F one-tailed
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "F",
  two.tailed = FALSE,
  df1 = 2,
  df2 = 2
)
# chisq one-tailed
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "chisq",
  two.tailed = FALSE,
  df = 1
)
# z one-tailed left
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "z",
  two.tailed = FALSE,
  right.tail = FALSE
)
# t one-tailed left
## vector
ci2crit(
  ci = c(
    0.999,
    0.99,
    0.95
  ),
  dist = "t",
  two.tailed = FALSE,
  right.tail = FALSE,
  df = 5
)

jeksterslabds/jeksterslabRboot documentation built on July 20, 2020, 12:56 p.m.