interval_var2: Two sided interval estimation of 'sigma1^2 / sigma2^2' of two...

View source: R/interval_var2.R

interval_var2R Documentation

Two sided interval estimation of sigma1^2 / sigma2^2 of two normal samples

Description

Compute the two sided interval estimation of sigma1^2 / sigma2^2 of two normal samples when the population means are known or unknown.

Usage

interval_var2(x, y, mu = c(Inf, Inf), alpha = 0.05)

Arguments

x

A numeric vector.

y

A numeric vector.

mu

The population means. When it is known, input it, and the function computes the interval endpoints using an F distribution with degree of freedom (n1, n2). When it is unknown, ignore it, and the function computes the interval endpoints using an F distribution with degree of freedom (n1-1, n2-1).

alpha

The significance level, a real number in [0, 1]. Default to 0.05. 1-alpha is the degree of confidence.

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.

a

The confidence lower limit.

b

The confidence upper limit.

Author(s)

Ying-Ying Zhang (Robert) robertzhangyying@qq.com

References

Zhang, Y. Y., Wei, Y. (2013), One and two samples using only an R funtion, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2991/asshm-13.2013.29")}.

Examples

x=rnorm(10, mean = 1, sd = 0.2); x
y=rnorm(20, mean = 2, sd = 0.3); y
interval_var2(x, y, mu = c(1,2))
interval_var2(x, y)

OneTwoSamples documentation built on March 31, 2023, 11:49 p.m.