mtram | R Documentation |
Marginally interpretable transformation models for clustered data.
mtram(object, formula, data,
grd = SparseGrid::createSparseGrid(type = "KPU",
dimension = length(rt$cnms[[1]]), k = 10),
tol = .Machine$double.eps, optim = mltoptim(auglag = list(maxtry = 5)),
...)
object |
A |
formula |
A formula specifying the random effects. |
data |
A data frame. |
grd |
A sparse grid used for numerical integration to get the likelihood. |
tol |
numerical tolerance. |
optim |
a list of optimisers as returned by |
... |
Additional argument. |
A Gaussian copula with a correlation structure obtained from a random
intercept or random intercept / random slope model (that is, clustered or
longitudinal data can by modelled only) is used to capture the
correlations whereas the marginal distributions are described by a
transformation model. The methodology is described in Barbanti and Hothorn
(2022) and examples are given in the mtram
package vignette.
Only coef()
and logLik()
methods are available at the
moment, see vignette("mtram", package = "tram")
for worked
examples.
An object of class tram
with coef()
and logLik()
methods.
Luisa Barbanti and Torsten Hothorn (2024). A Transformation Perspective on Marginal and Conditional Models, Biostatistics, 25(2), 402–428, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biostatistics/kxac048")}.
vignette("mtram", package = "tram")
if (require("lme4")) {
### linear mixed model
sleep_lmer <- lmer(Reaction ~ Days + (Days | Subject),
data = sleepstudy, REML = FALSE)
### marginal transformation model
sleep_LM <- Lm(Reaction ~ Days, data = sleepstudy)
sleep_LMmer <- mtram(sleep_LM, ~ (Days | Subject), data = sleepstudy)
### the same
logLik(sleep_lmer)
logLik(sleep_LMmer)
### Lm / mtram estimate standardised effects
sdinv <- 1 / summary(sleep_lmer)$sigma
fixef(sleep_lmer) * c(-1, 1) * sdinv
coef(sleep_LMmer)[c("(Intercept)", "Days")]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.