var_test2: Two sided or one sided test of hypothesis of sigma1^2 and sigma2^2 of two normal samples
Description
Compute the two sided or one sided test of hypothesis of sigma1^2 and sigma2^2 of two normal samples when the population means are known or unknown.
Usage
var_test2(x, y, mu = c(Inf, Inf), side = 0)
Value
A data.frame with variables:
rate
The estimate of the ratio of population variances, rate = Sx2/Sy2. When the population means mu is known, Sx2 = 1/n1*sum((x-mu[1])^2) and
Sy2 = 1/n2*sum((y-mu[2])^2. When mu is unknown, Sx2 = var(x) and Sy2 = var(y).
df1
The first degree of freedom.
df2
The second degree of freedom.
F
The F statistic.
p_value
The P value.
Arguments
x
A numeric vector.
y
A numeric vector.
mu
The population means. When it is known, input it, and the function computes the F value using an F distribution with degree of freedom (n1, n2). When it is unknown, ignore it, and the function computes the F value using an F distribution with degree of freedom (n1-1, n2-1).
side
A parameter used to control two sided or one sided test of hypothesis. When inputting side = 0 (default), the function computes two sided test of hypothesis, and H1: sigma1^2 != sigma2^2; when inputting side = -1 (or a number < 0), the function computes one sided test of hypothesis, and H1: sigma1^2 < sigma2^2; when inputting side = 1 (or a number > 0), the function computes one sided test of hypothesis, and H1: sigma1^2 > sigma2^2.