Description Usage Arguments Details Value References Examples
Fit (Generalized) Linear Mixed Models with user
defined 'G-site' covariance relationship matrices. Derifed from
pedigreemm
.
1 2 3 |
formula |
a two-sided linear formula object describing both the
fixed-effects and random-effects part of the model, with the
response on the left of a |
data |
an optional data frame containing the variables named in
|
family |
a GLM family, see |
REML |
logical scalar - Should the estimates be chosen to optimize the REML criterion (as opposed to the log-likelihood)? |
covarrel |
a named list of relationship matrices. The names must
correspond to the names of grouping factors for random-effects terms in the
|
control |
a list (of correct class, resulting from
|
start |
a named |
verbose |
integer scalar. If |
subset |
an optional expression indicating the subset of the rows
of |
weights |
an optional vector of ‘prior weights’ to be used
in the fitting process. Should be |
na.action |
a function that indicates what should happen when the
data contain |
offset |
this can be used to specify an a priori known
component to be included in the linear predictor during
fitting. This should be |
contrasts |
an optional list. See the |
devFunOnly |
logical - return only the deviance evaluation function. Note that because the deviance function operates on variables stored in its environment, it may not return exactly the same values on subsequent calls (but the results should always be within machine tolerance). |
... |
other potential arguments. A |
All arguments to this function are the same as those to the
function lmer
(or in case of family
glmer
) except covarrel
which must be a
named list of relationship matrices. 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 column and row names of the relationship
matrix. For each relationship matrix the (left) Cholesky factor of the
observed levels is calculated and applied to the model matrix for that term.
a pedigreemm
object.
Vazquez, A.I., D.M. Bates, G.J.M. Rosa, D. Gianola and K.A. Weigel. (2010). Technical Note: An R package for fitting generalized linear mixed models in animal breeding. Journal of Animal Science, 88:497-504.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # modifide from pedigreemm example
# pedigree and relationship matrix
p1 <- new("pedigree",
sire = as.integer(c(NA, NA, 1, 1, 4, 5, 1, 4, 4, 5)),
dam = as.integer(c(NA, NA, 2, NA, 3, 2, 3, 6, 6, 2)),
label = as.character(1:10))
A <- pedigreemm::getA(p1)
cholA <- chol(A)
# variance componens
varU <- 2
varE <- 6
# number of observations
rep <- 20
n <- rep * 10
ID <- rep(1:10, each = rep)
# simulated random effects
set.seed(108)
bStar <- rnorm(10)
bStar <- bStar * (sqrt(varU) / sd(bStar[ID]))
b <- as.vector(crossprod(cholA, bStar))
# simulated error
e0 <- rnorm(n)
e0 <- e0 * (sqrt(varE) / sd(e0))
# simulated observations
y <- 10 + b[ID] + e0
# models
fm1 <- pedigreemm(y ~ (1 | ID) , pedigree = list(ID = p1))
fm2 <- mm(formula = y ~ (1 | ID) , covarrel = list(ID = A))
# require(coxme)
# fm3 <- lmekin(y ~ (1 | ID) , varlist = list(ID = A), method = "REML")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.