test.equality.mixed: Performs Chi-Square Test for Mixed Effects Mixtures

test.equality.mixedR Documentation

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

test.equality

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 documentation built on Dec. 5, 2022, 5:23 p.m.