ht_1pop_var {statBasics}R Documentation

Hypothesis testing for the population variance

Description

One-Sample chi-squared test on variance.

Usage

ht_1pop_var(
  x,
  sigma = 1,
  alternative = "two.sided",
  conf_level = NULL,
  sig_level = 0.05,
  na.rm = TRUE
)

Arguments

x

a (non-empty) numeric vector.

sigma

a number indicating the true value of the standard deviation in the null hypothesis. Default value is 1.

alternative

a character string specifying the alternative hypothesis, must be one of ‘"two.sided"’ (default), ‘"greater"’ or ‘"less"’. You can specify just the initial letter.

conf_level

a number indicating the confidence level to compute the confidence interval. If conf_level = NULL, then the confidence interval is not included in the output. Default value is NULL.

sig_level

a number indicating the significance level to use in the General Procedure for Hypotheiss Testing.

na.rm

a logical value indicating whether NA values should be remove before the computation proceeds.

Details

We have wrapped the EnvStats::varTest in a function as explained in the book of Montgomery and Runger (2010) <ISBN: 978-1-119-74635-5>.

Value

a tibble with the following columns:

statistic

the value of the test statistic.

p_value

the p-value for the test.

critical_value

critical value in the General Procedure for Hypothesis Testing.

critical_region

critical region in the General Procedure for Hypothesis Testing.

sigma

a number indicating the true value of sigma.

alternative

character string giving the direction of the alternative hypothesis.

lower_ci

lower bound of the confidence interval. It is presented only if !is.null(con_level).

upper_ci

upper bound of the confidence interval. It is presented only if !is.null(con_level).

Examples

sample <- rnorm(1000, mean = 10, sd = 2)
ht_1pop_var(sample, sigma = 1) # H0: sigma = 1

[Package statBasics version 0.2.0 Index]