minque: MINQUE estimation of variance components

Description Usage Arguments Value Author(s) Examples

View source: R/minque.R

Description

Estimate variance components by MINQUE method, allowing multiple iterations

Usage

1
minque(y, X, Kerns, n.iter = 1, eps = 0.001)

Arguments

y

Numeric vector of traits. Only continuous trait currently allowed.

X

Matrix of covariates (columns) for subjects (rows), matching subjects in the trait (y) vector.

Kerns

List of kernel matrices: a kernel matrix for each variance compenent. The last kernel matrix in the list (an identity matrix) is for the residual variance component.

n.iter

Number of minque iterations

eps

Default small positive value for non-positive vc estimates within iterations.

Value

List with estimates of variance components (vc), covariate regression coefficients (beta), and residuals of model fit.

Author(s)

JP Sinnwell, DJ Schaid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(vcexample)
nvc <- 1+length(unique(doseinfo[,2]))
id <- 1:nrow(dose)
## vcs for genetic kernel matrices
Kerns <- vector("list", length=nvc)
for(i in 1:(nvc-1)){
  Kerns[[i]] <- kernel_linear(dose[,grep(i, doseinfo[,2])])
  rownames(Kerns[[i]]) <- id
  colnames(Kerns[[i]]) <- id
}
## vc for residual variance
Kerns[[nvc]] <- diag(nrow(dose))
rownames(Kerns[[nvc]]) <- id
colnames(Kerns[[nvc]]) <- id
prefit  <- minque(response, covmat, Kerns, n.iter=2)
prefit[1]
prefit[2]
fit <- vcpen(response, covmat, Kerns, vc_init = prefit$vc)

vcpen documentation built on Jan. 3, 2022, 5:12 p.m.