Learn R Programming

MMeM (version 0.1.1)

MMeM_reml: Multivariate REML Method

Description

Estimating the variance components under the multivariate mixed effects model using REML methods

Usage

MMeM_reml(fml, data, factor_X, T.start, E.start, maxit = 50,
  tol = 1e-09)

Arguments

fml

a two-sided linear formula object describing both the fixed-effects and random-effects parts of the model, with the response on the left of a ~ operator. For univariate response, put variable name directly; for multivariate responses combine variables using concatenate operator, for example, for bivariate responses, c(var1, var2). The predictor terms are separated by + operators, on the right. Random-effects terms are distinguished by vertical bars '|' separating expressions for design matrices from grouping factors.

data

data frame containing the variables named in formula.

factor_X

(logical) indicating whether predictor is a factor or continuous. By default is TRUE

T.start

the starting matrix for the variance covariance matrix of the block random effects, it has to be positive definite q by q symmetric matrix.

E.start

the starting matrix for the variance covariance matrix of the block random effects, it has to be positive definite q by q symmetric matrix.

maxit

the maximum number of iterations

tol

the convergence tolerance

Value

The function returns a list with the following objects:

  • T.estimates is the estimated variance covariance components of the variance covariance matrix of the block random effects

  • E.estimates is the estimated variance covariance components of the variance covariance matrix of the residuals

  • VCOV is the asymptotic dispersion matrix of the estimated variance covariance components for the block random effects and the residuals.

Details

Suppose n observational units, q variates, p fixed effects coefficients and s random effects units. The model supports multivariate mixed effects model for one-way randomized block design with equal design matrices: $$Y = XB + ZU + E$$ where Y is n by q response variates matrix; X is n by p design matrix for the fixed effects; B is p by q coefficients matrix for the fixed effects; Z is n by s design matrix for the random effects; U is s by q matrix for the random effects; E is n by q random errors matrix.

The model also supports simple OLS multivariate regression: $$y = Xb + Zu + e$$ where y is n by 1 response vector; b is p by 1 coefficients vector for the fixed effects; u is s by 1 matrix for the random effects.

References

Meyer, K. "Maximum likelihood estimation of variance components for a multivariate mixed model with equal design matrices." Biometrics 1985: 153,165.

Examples

Run this code
# NOT RUN {
data(simdata)
T.start <- matrix(c(10,5,5,15),2,2)
E.start <- matrix(c(10,1,1,3),2,2)
results_reml <- MMeM_reml(fml = c(V1,V2) ~ X_vec + (1|Z_vec), data = simdata,
factor_X = TRUE, T.start = T.start, E.start = E.start, maxit = 10)


# }

Run the code above in your browser using DataLab