lmekin | R Documentation |
The lmekin function fits a linear mixed effects model, with random
effects specified in the same structure as in the coxme
function.
lmekin(formula, data, weights, subset, na.action, control,
varlist, vfixed, vinit, method = c("ML", "REML"),
x = FALSE, y = FALSE, model=FALSE,
random, fixed, variance, ...)
formula |
a two-sided formula with the response as the left hand side of a
|
data |
an optional data frame containing the variables named in the |
subset , weights , na.action |
further model specifications arguments as in |
control |
optional list of control options. See |
varlist |
the variance family to be used for each random term. If there are
multiple terms it will be a list of variance functions.
The default is |
vfixed |
optional named list or vector used to fix the value of one or more of the variance terms at a constant. |
vinit |
optional named list or vector giving suggested starting values for the variance. |
method |
fit using either maximum likelihood or restricted maximum likelihood |
x |
if TRUE the X matrix (fixed effects) is included in the output object |
y |
if TRUE the y variable is included in the output object |
model |
if TRUE the model frame is included in the output object |
fixed , random , variance |
In an earlier version of |
... |
any other arguments are passed forward to |
Let A= \sigma^2 B
be the variance matrix of the random
effects where \sigma^2
is the residual variance for the
model. Internally the routine solves for the parameters of
B
, computing A
at the end. The vinit
and
vfixed
parmaters refer to B
, however.
It is possible to specify certain models in lmekin
that can not be fit with lme, in particular models with
familial genetic effects, i.e., a kinship matrix, and hence the
name of the routine. Using user-specified variance functions an even
wider range of models is possible.
For simple models the specification of the random effects follows the
same form as the lmer
function. For any model which can be fit
by both lmekin
and lmer
, the latter routine would
normally be prefered due to a much wider selection of post-fit tools
for residuals, prediction and plotting.
Much of the underlying model code for specification and manipulation
of the random effects is shared with the coxme
routine. In
fact lmekin was originally written only to provide a test routine for
those codes, and no expectation that it would find wider utility.
An object of class lmekin
.
Terry Therneau
lmekin.object
, coxme
data(ergoStool, package="nlme") # use a data set from nlme
fit1 <- lmekin(effort ~ Type + (1|Subject), data=ergoStool)
## Not run:
# gives the same result
require(nlme)
fit2 <- lme(effort ~ Type, data=ergoStool, random= ~1|Subject,
method="ML")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.