Fit mixed-effects models incorporating pedigrees

Share:

Description

Fit linear or generalized linear mixed models incorporating the effects of a pedigree.

Usage

1
2
3
4
5
pedigreemm(formula, data, family = NULL, REML = TRUE,
           pedigree = list(), control = list(),
           start = NULL, verbose = FALSE, subset, weights,
           na.action, offset, contrasts = NULL, model = TRUE,
           x = TRUE, ...)

Arguments

pedigree

a named list of pedigree objects. The names must correspond to the names of grouping factors for random-effects terms in the formula argument.

formula

as in lmer

data

as in lmer

family

as in glmer

REML

as in lmer

control

as in lmer

start

as in lmer

verbose

as in lmer

subset

as in lmer

weights

as in lmer

na.action

as in lmer

offset

as in lmer

contrasts

as in lmer

model

as in lmer

x

as in lmer

...

as in lmer

Details

All arguments to this function are the same as those to the function lmer except pedigree which must be a named list of pedigree objects. Each name (frequently there is only one) must correspond to the name of a grouping factor in a random-effects term in the formula. The observed levels of that factor must be contained in the pedigree. For each pedigree the (left) Cholesky factor of the relationship matrix restricted to the observed levels is calculated using relfactor and applied to the model matrix for that term.

Value

a pedigreemm object.

References

2010. A.I. Vazquez, D.M. Bates, G.J.M. Rosa, D. Gianola and K.A. Weigel. Technical Note: An R package for fitting generalized linear mixed models in animal breeding. Journal of Animal Science, 88:497-504.

See Also

pedigreemm, pedigree, relfactor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  p1 <- new("pedigree",
           sire = as.integer(c(NA,NA,1, 1,4,5)),
           dam  = as.integer(c(NA,NA,2,NA,3,2)),
           label = as.character(1:6))
  A<-getA(p1)
  cholA<-chol(A)  
  varU<-0.4; varE<-0.6; rep<-20
  n<-rep*6
  set.seed(108)
  bStar<- rnorm(6, sd=sqrt(varU))
  b<-crossprod(as.matrix(cholA),bStar)
  ID <- rep(1:6, each=rep)
  e0<-rnorm(n, sd=sqrt(varE))
  y<-b[ID]+e0
  fm1 <- pedigreemm(y ~ (1|ID) , pedigree = list(ID = p1))
  table(y01<-ifelse(y<1.3,0,1))
  fm2 <- pedigreemm(y01 ~ (1|ID) , pedigree = list(ID = p1), family = 'binomial')