iid.lmm | R Documentation |
Extract the influence function for an ML or REML estimator of parameters from a linear mixed model.
## S3 method for class 'lmm'
iid(
x,
effects = "mean",
p = NULL,
robust = TRUE,
type.information = NULL,
transform.sigma = NULL,
transform.k = NULL,
transform.rho = NULL,
transform.names = TRUE,
REML2ML = NULL,
...
)
x |
a |
effects |
[character] Should the influence function for all coefficients be output ( |
p |
[numeric vector] value of the model coefficients at which to evaluate the influence function. Only relevant if differs from the fitted values. |
robust |
[logical] If |
type.information |
[character] Should the expected information be used (i.e. minus the expected second derivative) or the observed inforamtion (i.e. minus the second derivative). |
transform.sigma |
[character] Transformation used on the variance coefficient for the reference level. One of |
transform.k |
[character] Transformation used on the variance coefficients relative to the other levels. One of |
transform.rho |
[character] Transformation used on the correlation coefficients. One of |
transform.names |
[logical] Should the name of the coefficients be updated to reflect the transformation that has been used? |
... |
Not used. For compatibility with the generic method. |
The influence function equals the individual score rescaled by the (inverse) information. With the expected information and for a lmm fitted using ML, the information is block diagonal so the influence function for the mean and variance parameters can be computed separately. Otherwise the information and individual score relative to all model parameters should be considered. The later is probablematic when using REML as the REML term is the ratio of two term linear in the individual contributions which is not itself linear in the individual contributions. As an add-hoc solution, the denominator is treated as fixed so the ratio is decomposed w.r.t. its numerator.
A matrix with one row per observation and one column per parameter.
df=TRUE
: with an attribute "df"
containing a numeric vector with one element per parameter.
effects
includes "gradient"
: with an attribute "gradient"
containing a 3 dimensional array with dimension the number of parameters.
data(gastricbypassL)
#### Case WITHOUT cross terms ####
e.lmmREML <- lmm(weight ~ visit, method.fit = "REML", df = FALSE,
repetition = ~ visit|id, data = gastricbypassL)
e.lmmML <- lmm(weight ~ visit, method.fit = "ML", df = FALSE,
repetition = ~ visit|id, data = gastricbypassL)
name.mu <- names(coef(e.lmmREML, effects = "mean"))
name.sigmakrho <- names(coef(e.lmmREML, effects = c("variance","correlation")))
info.REML <- information(e.lmmREML, effects = "all", transform.names = FALSE)
info.ML <- information(e.lmmML, effects = "all", transform.names = FALSE)
info.REML2ML <- information(e.lmmML, p = coef(e.lmmREML, effects = "all"),
effects = "all", transform.names = FALSE)
range(info.REML[name.mu,name.sigmakrho])
range(info.ML[name.mu,name.sigmakrho])
range(info.REML[name.mu,]-info.REML2ML[name.mu,])
range(iid(e.lmmREML, REML2ML = TRUE) - iid(e.lmmREML, REML2ML = FALSE))
## neglectable differences
#### Case WITH cross terms ####
e2.lmmREML <- lmm(glucagonAUC ~ visit + weight, method.fit = "REML", df = FALSE,
repetition = ~ visit|id, data = gastricbypassL)
e2.lmmML <- lmm(glucagonAUC ~ visit + weight, method.fit = "ML", df = FALSE,
repetition = ~ visit|id, data = gastricbypassL)
name2.mu <- names(coef(e2.lmmREML, effects = "mean"))
name2.sigmakrho <- names(coef(e2.lmmREML, effects = c("variance","correlation")))
info2.REML <- information(e2.lmmREML, effects = "all", transform.names = FALSE)
info2.ML <- information(e2.lmmML, effects = "all", transform.names = FALSE)
info2.REML2ML <- information(e2.lmmML, p = coef(e2.lmmREML, effects = "all"),
effects = "all", transform.names = FALSE)
range(info2.REML[name.mu,]-info2.REML2ML[name.mu,])
## neglectable difference
range(info2.REML[name.mu,name.sigmakrho])
range(info2.ML[name.mu,name.sigmakrho])
range(iid(e2.lmmREML, REML2ML = TRUE) - iid(e2.lmmREML, REML2ML = FALSE))
## non-neglectable differences
diag(crossprod(iid(e2.lmmREML, REML2ML = TRUE)))/diag(vcov(e2.lmmREML))
diag(crossprod(iid(e2.lmmREML, REML2ML = FALSE)))/diag(vcov(e2.lmmREML))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.