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

test.equality.mixed

Performs Chi-Square Test for Mixed Effects Mixtures


Description

Performs a likelihood ratio test of either common variance terms between the response trajectories in a mixture of random (or mixed) effects regressions or for common variance-covariance matrices for the random effects mixture distribution.

Usage

test.equality.mixed(y, x, w=NULL, arb.R = TRUE, 
                    arb.sigma = FALSE, lambda = NULL, 
                    mu = NULL, sigma = NULL, R = NULL, 
                    alpha = NULL, ...)

Arguments

y

The responses for regmixEM.mixed.

x

The predictors for the random effects in regmixEM.mixed.

w

The predictors for the (optional) fixed effects in regmixEM.mixed.

arb.R

If FALSE, then a test for different variance-covariance matrices for the random effects mixture is performed.

arb.sigma

If FALSE, then a test for different variance terms between the response trajectories is performed.

lambda

A vector of mixing proportions (under the null hypothesis) with same purpose as outlined in regmixEM.mixed.

mu

A matrix of the means (under the null hypothesis) with same purpose as outlined in regmixEM.mixed.

sigma

A vector of standard deviations (under the null hypothesis) with same purpose as outlined in regmixEM.mixed.

R

A list of covariance matrices (under the null hypothesis) with same purpose as outlined in regmixEM.mixed.

alpha

An optional vector of fixed effects regression coefficients (under the null hypothesis) with same purpose as outlined in regmixEM.mixed.

...

Additional arguments passed to regmixEM.mixed.

Value

test.equality.mixed 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

##Test of equal variances in the simulated data set.

data(RanEffdata)
set.seed(100)
x<-lapply(1:length(RanEffdata), function(i) 
          matrix(RanEffdata[[i]][, 2:3], ncol = 2))
x<-x[1:15]
y<-lapply(1:length(RanEffdata), function(i) 
          matrix(RanEffdata[[i]][, 1], ncol = 1))
y<-y[1:15]

out<-test.equality.mixed(y, x, arb.R = TRUE, arb.sigma = FALSE,
                         epsilon = 1e-1,  verb = TRUE,
                         maxit = 50,
                         addintercept.random = FALSE)
out

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.