
Last chance! 50% off unlimited learning
Sale ends in
LeveneTest(y, ...)
## S3 method for class 'formula':
LeveneTest(y, data, ...)
## S3 method for class 'lm':
LeveneTest(y, ...)
## S3 method for class 'default':
LeveneTest(y, group, center=median, ...)
lm
or
formula
object. If y
is a linear-model object or a formula,
the variables on the right-hand-side of the model must all be factors and
must be completely mean
gives the original Levene's test; the default, median
,
provides a more robust test (Brown-Forsythe-Test).formula
.data
for the
formula
and lm
methods; can also be used to pass arguments to
the function given by center
(e.g., center=mean
and
trim=0.1
fligner.test
for a rank-based (nonparametric)
$k$-sample test for homogeneity of variances;
mood.test
for another rank-based two-sample test for a
difference in scale parameters;
var.test
and bartlett.test
for parametric
tests for the homogeneity in variance.
ansari_test
in package {coin}
for exact and approximate conditional p-values for the
Ansari-Bradley test, as well as different methods for handling ties.## example from ansari.test:
## Hollander & Wolfe (1973, p. 86f):
## Serum iron determination using Hyland control sera
ramsay <- c(111, 107, 100, 99, 102, 106, 109, 108, 104, 99,
101, 96, 97, 102, 107, 113, 116, 113, 110, 98)
jung.parekh <- c(107, 108, 106, 98, 105, 103, 110, 105, 104,
100, 96, 108, 103, 104, 114, 114, 113, 108, 106, 99)
LeveneTest( c(ramsay, jung.parekh),
factor(c(rep("ramsay",length(ramsay)), rep("jung.parekh",length(jung.parekh)))))
LeveneTest( c(rnorm(10), rnorm(10, 0, 2)), factor(rep(c("A","B"),each=10)) )
# original example from package car
with(Moore, LeveneTest(conformity, fcategory))
with(Moore, LeveneTest(conformity, interaction(fcategory, partner.status)))
LeveneTest(conformity ~ fcategory * partner.status, data = Moore)
LeveneTest(conformity ~ fcategory * partner.status, data = Moore, center = mean)
LeveneTest(conformity ~ fcategory * partner.status, data = Moore, center = mean, trim = 0.1)
LeveneTest(lm(conformity ~ fcategory*partner.status, data = Moore))
Run the code above in your browser using DataLab