ht_2pop_var {statBasics}R Documentation

F Test to compare two variances

Description

Performs a F test to compare the variances of two normal populations.

Usage

ht_2pop_var(
  x,
  y,
  ratio = 1,
  alternative = "two.sided",
  conf_level = NULL,
  sig_level = 0.05,
  na_rm = FALSE
)

Arguments

x

a (non-empty) numeric vector.

y

a (non-empty) numeric vector.

ratio

the hypothesized ratio of the population variances of x and y. Default value is 1.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".

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 Hypothesis Testing.

na_rm

a logical value indicating whether NA values should be removed before the computation proceeds. Default value is FALSE.

Details

We have wrapped the var.test 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.

ratio

a scalar value indicating the value of ratio.

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(conf_level).

upper_ci

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

Examples

x <- rnorm(100, sd = 2)
y <- rnorm(1000, sd = 10)
ht_2pop_var(x, y)

[Package statBasics version 0.2.2 Index]