Learn R Programming

wle (version 0.5)

wle.var.test: Weighted F Test to Compare Two Variances

Description

Performs an Weighted F test to compare the variances of two samples from normal populations. The WF-test is based on weighted likelihood.

Usage

wle.var.test(x, y, ratio = 1, alternative = c("two.sided", "less", "greater"),
         conf.level = 0.95, x.root=1, y.root=1)

Arguments

x, y
fitted linear model objects (inheriting from class "wle.lm") or fitted normal model objects (inheriting from class "wle.normal").
ratio
the hypothesized ratio of the population variances of x and y.
alternative
the alternative hypothesis; must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.
conf.level
confidence level for the returned confidence interval.
x.root
the 'x' root used.
y.root
the 'y' root used.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the WF test statistic.
  • parameterthe degrees of the freedom of the WF distribtion of the test statistic.
  • p.valuethe p-value of the test.
  • conf.inta confidence interval for the ratio of the population variances.
  • estimatethe ratio of the sample variances from x and y.
  • null.valuethe ratio of population variances under the null.
  • alternativea character string describing the alternative hypothesis.
  • methodthe string "WF test to compare two variances".
  • data.namea character string giving the names of the data.

Details

The null hypothesis is that the ratio of the variances in the data to which the normal model (wle.normal) or linear models (wle.lm) x and y were fitted, is equal to ratio.

References

Agostinelli, C., (1998). Inferenza statistica robusta basata sulla funzione di verosimiglianza pesata: alcuni sviluppi, Ph.D Thesis, Department of Statistics, University of Padova (in italian).

Agostinelli, C., (1998). Un approccio robusto alla verifica d'ipotesi basato sulla funzione di verosimiglianza pesata - Robust Testing Hypotheses via Weighted Likelihood function, submitted to {Statistica, revised february 2000 (in italian).

Agostinelli, C., Markatou, M. (2001) Test of hypotheses based on the Weighted Likelihood Methodology, in print {Statistica Sinica probably vol. 11, n. 2, Aprile 2001.

}

Claudio Agostinelli

set.seed(1234)

x <- rnorm(30,0,1) y <- rnorm(30,10,1)

res.x <- wle.normal(x,group=5) res.y <- wle.normal(y,group=5)

wle.var.test(res.x, res.y) # Do x and y have the same variance?

set.seed(1234)

x <- c(rnorm(30,0,1),rnorm(10,10,1)) y <- c(rnorm(30,10,1),rnorm(10,0,5))

res.x <- wle.normal(x,group=5,num.sol=2) res.y <- wle.normal(y,group=5)

res.x wle.var.test(res.x, res.y, x.root=1) if (res.x$tot.sol>1) wle.var.test(res.x, res.y, x.root=2)

robust htest