Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

test.equality

Performs Chi-Square Tests for Scale and Location Mixtures


Description

Performs a likelihood ratio test of a location (or scale) normal or regression mixture versus the more general model. For a normal mixture, the alternative hypothesis is that each component has its own mean and variance, whereas the null is that all means (in the case of a scale mixture) or all variances (in the case of a location mixture) are equal. This test is asymptotically chi-square with degrees of freedom equal to k-1, where k is the number of components.

Usage

test.equality(y, x = NULL, arbmean = TRUE, arbvar = FALSE, 
              mu = NULL, sigma = NULL, beta = NULL, 
              lambda = NULL, ...)

Arguments

y

The responses for regmixEM or the data for normalmixEM.

x

The predictors for regmixEM.

arbmean

If FALSE, then a scale mixture analysis is performed for normalmixEM or regmixEM.

arbvar

If FALSE, then a location mixture analysis is performed for normalmixEM or regmixEM.

mu

An optional vector for starting values (under the null hypothesis) for mu in normalmixEM.

sigma

An optional vector for starting values (under the null hypothesis) for sigma in normalmixEM or regmixEM.

beta

An optional matrix for starting values (under the null hypothesis) for beta in regmixEM.

lambda

An otional vector for starting values (under the null hypothesis) for lambda in normalmixEM or regmixEM.

...

Additional arguments passed to the various EM algorithms for the mixture of interest.

Value

test.equality returns a list with the following items:

chi.sq

The chi-squared test statistic.

df

The degrees of freedom for the chi-squared test statistic.

p.value

The p-value corresponding to this likelihood ratio test.

See Also

Examples

## Should a location mixture be used for the Old Faithful data?

data(faithful)
attach(faithful)
set.seed(100)
test.equality(y = waiting, arbmean = FALSE, arbvar = TRUE)

mixtools

Tools for Analyzing Finite Mixture Models

v1.2.0
GPL (>= 2)
Authors
Derek Young [aut, cre] (<https://orcid.org/0000-0002-3048-3803>), Tatiana Benaglia [aut], Didier Chauveau [aut], David Hunter [aut], Ryan Elmore [ctb], Thomas Hettmansperger [ctb], Hoben Thomas [ctb], Fengjuan Xuan [ctb]
Initial release
2020-02-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.