test.equality | R Documentation |
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.
test.equality(y, x = NULL, arbmean = TRUE, arbvar = FALSE, mu = NULL, sigma = NULL, beta = NULL, lambda = NULL, ...)
y |
The responses for |
x |
The predictors for |
arbmean |
If FALSE, then a scale mixture analysis is performed for |
arbvar |
If FALSE, then a location mixture analysis is performed for |
mu |
An optional vector for starting values (under the null hypothesis) for |
sigma |
An optional vector for starting values (under the null hypothesis) for |
beta |
An optional matrix for starting values (under the null hypothesis) for |
lambda |
An otional vector for starting values (under the null hypothesis) for |
... |
Additional arguments passed to the various EM algorithms for the mixture of interest. |
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. |
test.equality.mixed
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.