Learn R Programming

CLME (version 1.0-1)

minque: MINQUE Algorithm

Description

Implements MINQUE algorithm to obtain estimates of variance parameters of a linear mixed effects model.

Usage

minque( Y , X1 , X2 = NULL , U = NULL , Nks = dim(X1)[1] ,
        Qs = dim(U)[2], mq.eps = sqrt(.Machine$double.eps) ,
        mq.iter = 500 , verbose = FALSE )

Arguments

Y
$N \times 1$ vector of response data.
X1
$N \times p_1$ design matrix.
X2
optional. $N \times p_2$ matrix of covariates.
U
optional. $N \times c$ matrix of random effects.
Nks
optional. $K \times 1$ vector of group sizes. See Details.
Qs
optional. $Q \times 1$ vector of group sizes for random effects.
mq.eps
criterion for convergence for the MINQUE algorithm.
mq.iter
maximum number of iterations permitted for the MINQUE algorithm.
verbose
if TRUE, function prints intermediate messages on progress of the MINQUE algorithm.

Value

  • The function returns a vector of the form $(\tau^{2}_{1}, \tau^{2}_{2}, \ldots, \tau^{2}_{q}, \sigma^{2}_{1},\sigma^{2}_{2},\ldots, \sigma^{2}_{k})'$. If there are no random effects, then the output is just $(\sigma^{2}_{1},\sigma^{2}_{2},\ldots, \sigma^{2}_{k})'$.

Details

By default, the model assumes homogeneity of variances for both the residuals and the random effects (if included). See the Details in CLME-package for more information on how to use the arguments Nks and Qs to permit heterogeneous variances.

References

Farnan, L., Ivanova, A., and Peddada, S. D. (2014). Linear Mixed Efects Models under Inequality Constraints with Applications. PLOS ONE, 9(1). e84778. doi: 10.1371/journal.pone.0084778 http://www.plosone.org/article/info:doi/10.1371/journal.pone.0084778

Examples

Run this code
set.seed( 42 )

n  <- 5
P1 <- 5

X1 <- diag(P1) %x% rep(1,n)
X2 <- as.matrix( rep(1,P1) %x% runif(n , 0,2) )
U  <- rep(1,P1) %x% diag(n)
X  <- as.matrix( cbind(X1,X2) )

tsq <- 1
ssq <- 0.7

Nks <- dim(X1)[1]
Qs  <- dim(U)[2]

xi <- rnorm( sum(Qs)  , 0 , rep(sqrt(tsq) , Qs)  )
ep <- rnorm( sum(Nks) , 0 , rep(sqrt(ssq) , Nks) )  

thetas <- c(2 , 3 , 3, 3 , 4 , 2 )
Y      <- X%*%thetas + U%*%xi + ep

# Assume homogeneity of variances and no covariates or random effects
minque( Y=Y , X1=X1 )

# Assume homogeneity of variances and include covariates and random effects
minque( Y=Y , X1=X1 , X2=X2 , U=U )

# Assume heterogeneity of variances, and include random effects
minque( Y=Y , X1=X1 , X2=X2 , U=U , Nks=Nks , Qs=Qs )

Run the code above in your browser using DataLab