Generates a plot to illustrate null hypothesis significance testing.

nhstplot(
  alpha = 0.05,
  ci = FALSE,
  dist = "z",
  two.tailed = TRUE,
  right.tail = TRUE,
  statistic = NULL,
  ...
)

Arguments

alpha

Numeric. Significance level \(\left( \alpha \right)\) .

ci

Logical. ci = FALSE by default. If TRUE, plot confidence interval. If FALSE, plot alpha level.

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.

statistic

Numeric. Test statistic. This is an optional argument.

...

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

See also

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

Examples

# ci = FALSE # two-tailed nhstplot( alpha = 0.05, dist = "z", statistic = 3 )
nhstplot( alpha = 0.05, dist = "t", df = 5 )
# one-tailed nhstplot( alpha = 0.05, two.tailed = FALSE, right.tail = TRUE )
nhstplot( alpha = 0.05, two.tailed = FALSE, right.tail = FALSE )
nhstplot( alpha = 0.05, dist = "t", two.tailed = FALSE, right.tail = TRUE, df = 5 )
nhstplot( alpha = 0.05, dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 5 )
nhstplot( alpha = 0.05, dist = "F", df1 = 10, df2 = 3 )
nhstplot( alpha = 0.05, dist = "chisq", df = 3 )
# ci = TRUE # two-tailed nhstplot( alpha = 0.05, ci = TRUE, dist = "z", statistic = 3 )
nhstplot( alpha = 0.05, ci = TRUE, dist = "t", df = 5 )
# one-tailed nhstplot( alpha = 0.05, ci = TRUE, two.tailed = FALSE, right.tail = TRUE )
nhstplot( alpha = 0.05, ci = TRUE, two.tailed = FALSE, right.tail = FALSE )
nhstplot( alpha = 0.05, ci = TRUE, dist = "t", two.tailed = FALSE, right.tail = TRUE, df = 5 )
nhstplot( alpha = 0.05, ci = TRUE, dist = "t", two.tailed = FALSE, right.tail = FALSE, df = 5 )
nhstplot( alpha = 0.05, ci = TRUE, dist = "F", df1 = 10, df2 = 3 )
nhstplot( alpha = 0.05, ci = TRUE, dist = "chisq", df = 3 )