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 |
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 |
sig_level |
a number indicating the significance level to use in the General Procedure for Hypothesis Testing. |
na_rm |
a logical value indicating whether |
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)