Levene.Test {LaplacesDemon}  R Documentation 
Levene's Test
Description
The Levene.Test
function is a Bayesian form of Levene's test
(Levene, 1960) of equality of variances.
Usage
Levene.Test(x, Method="U", G=NULL, Data=NULL)
Arguments
x 
This required argument must be an object of class

Method 
The method defaults to 
G 
This argument defaults to 
Data 
This argument is required when the DV is multivariate,
hence when 
Details
This function is a Bayesian form of Levene's test. Levene's test is used to assess the probability of the equality of residual variances in different groups. When residual variance does not differ by group, it is often called homoscedastic (or homoskedastic) residual variance. Homoskedastic residual variance is a common assumption. An advantage of Levene's test to other tests of homoskedastic residual variance is that Levene's test does not require normality of the residuals.
The Levene.Test
function estimates the test statistic,
W
, as per Levene's test. This Bayesian form, however,
estimates W
from the observed residuals as
W^{obs}
, and W
from residuals that are
replicated from a homoskedastic process as W^{rep}
.
Further, W^{obs}
and W^{rep}
are
estimated for each posterior sample. Finally, the probability that
the distribution of W^{obs}
is greater than the
distribution of W^{rep}
is reported (see below).
Value
The Levene.Test
function returns a plot (or for multivariate Y,
a series of plots), and a vector with a length equal to the number of
Levene's tests conducted.
One plot is produced per univariate application of Levene's test. Each
plot shows the test statistic W, both from the observed process
(W.obs as a black density) and the replicated process (W.rep as a red
line). The mean of W.obs is reported, along with its 95% quantilebased
probability interval (see p.interval
), the probability
p(W^{obs} > W^{rep})
, and the indicated
results, either homoskedastic or heteroskedastic.
Each element of the returned vector is the probability
p(W^{obs} > W^{rep})
. When the probability
is p < 0.025
or p > 0.975
,
heteroskedastic variance is indicated. Otherwise, the variances of
the groups are assumed not to differ effectively.
Author(s)
Statisticat, LLC. software@bayesianinference.com
References
Levene, H. (1960). "Robust Tests for Equality of Variances". In I. Olkins, S. G. Ghurye, W. Hoeffding, W. G. Madow, & H. B. Mann (Eds.), Contributions to Probability and Statistics, p. 278–292. Stanford University Press: Stanford, CA.
See Also
IterativeQuadrature
,
LaplaceApproximation
,
LaplacesDemon
,
PMC
,
p.interval
, and
VariationalBayes
.
Examples
#First, update the model with IterativeQuadrature, LaplaceApproximation,
# LaplacesDemon, PMC, or VariationalBayes.
#Then, use the predict function, creating, say, object Pred.
#Finally:
#Levene.Test(Pred)