minque: MINQUE Algorithm

Description Usage Arguments Details Value Note Examples

View source: R/minque.r

Description

Algorithm to obtain MINQUE estimates of variance components of a linear mixed effects model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
minque(
  Y,
  X1,
  X2 = NULL,
  U = NULL,
  Nks = dim(X1)[1],
  Qs = dim(U)[2],
  mq.eps = 1e-04,
  mq.iter = 500,
  verbose = FALSE,
  ...
)

Arguments

Y

Nx1 vector of response data.

X1

Nxp1 design matrix.

X2

optional Nxp2 matrix of covariates.

U

optional Nxc matrix of random effects.

Nks

optional Kx1 vector of group sizes.

Qs

optional Qx1 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 messages on progress of the MINQUE algorithm.

...

space for additional arguments.

Details

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

Value

The function returns a vector of the form (tau1^2, tau2^2, …, tauq^2, sigma1^2,sigma2^2,…, sigmak^2)'. If there are no random effects, then the output is just (sigma1^2,sigma2^2,…, sigmak^2)'.

Note

This function is called by several other function in CLME to obtain estimates of the random effect variances. If there are no random effects, they will not call minque.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data( rat.blood )

model_mats <- model_terms_clme( mcv ~ time + temp + sex + (1|id) , 
                                data = rat.blood )
Y  <- model_mats$Y
X1 <- model_mats$X1
X2 <- model_mats$X2
U  <- model_mats$U

# No covariates or random effects
minque(Y = Y, X1 = X1 )

# Include covariates and random effects
minque(Y = Y, X1 = X1, X2 = X2, U = U )

CLME documentation built on July 8, 2020, 5:49 p.m.