test.equality.mixed {mixtools} | R 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 |
x |
The predictors for the random effects in |
w |
The predictors for the (optional) fixed effects in |
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 |
mu |
A matrix of the means (under the null hypothesis) with same purpose as outlined in |
sigma |
A vector of standard deviations (under the null hypothesis) with same purpose as outlined in |
R |
A list of covariance matrices (under the null hypothesis) with same purpose as outlined in |
alpha |
An optional vector of fixed effects regression coefficients (under the null hypothesis) with same purpose as outlined
in |
... |
Additional arguments passed to |
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