lme,
but allowing for a complete specification of the
covariance matrix for the random effects.
lmekin(fixed, data=sys.parent, random,
varlist, variance, sparse=c(20, .05),
rescale=T, pdcheck=T,
subset, weight, na.action)
fixed,
random,
weights,
subset.
By default the variables are taken from the environment
from which
lmekin is called.
bdsmatrix,
describing the variance/covariance structure of one or more of the random
effects.
data
that should be used in the fit.
This can be a logical vector,
a numeric vector indicating which observation numbers are to be included,
or a character vector of the row names to be included.
All observations are included by default.
NAs.
The default action (
na.fail)
causes
lme to print an error message
and terminate if there are any incomplete observations.
The lme function is designed to accept a prototype for the variance matrix of the random effects, with the same prototype applying to all of the groups in the data. For familial genetic random effects, however, each family has a different covariance pattern, necessitating the input of the entire set of covariance matrices. In return, at present lmekin does not have the prototype abilities of lme.
Pinheiro, J. C. and Bates., D. M. (2000). Mixed Effect Models in S and S-PLUS. New York: Springer.
#
# Make a kinship matrix for the entire study
# These two functions are NOT fast, the makekinship one in particular
#
cfam <- makefamid(main$gid, main$momid, main$dadid)
kmat <- makekinship(cfam, main$gid, main$momid, main$dadid)
# The kinship matrix for the females only: quite a bit smaller
kid <- dimnames(kmat)[[1]]
temp <- main$sex[match(kid, main$gid)] == 'F'
fkmat <- kmat[temp,temp]
# The dimnames on kmat are the gid value, which are necessary to match
# the appropriate row/col of kmat to the analysis data set
# A look at %dense tissue on a mammogram, with age at mammogram and
# weight as covariates, and a familial random effect
fit <- lmekin(percdens ~ mammage + weight, data=anal1,
random = ~1|gid, kmat=fkmat)