rbind.Wald_lmm | R Documentation |
Combine linear hypothesis tests from possibly different linear mixed models.
## S3 method for class 'Wald_lmm'
rbind(
model,
...,
effects = NULL,
rhs = NULL,
univariate = TRUE,
multivariate = TRUE,
name = NULL,
name.short = TRUE,
sep = ": "
)
model |
a |
... |
possibly other |
effects |
[character or numeric matrix] how to combine the left-hand side of the hypotheses.
By default identity matrix but can also be |
rhs |
[numeric vector] the right hand side of the hypothesis. Should have the same length as the number of row of argument |
univariate |
[logical] Should an estimate, standard error, confidence interval, and p-value be output for each hypothesis? |
multivariate |
[logical] Should all hypotheses be simultaneously tested using a multivariate Wald test? |
name |
[character vector or NULL] character used to identify each model in the output. By default, use the name of the outcome of the model. |
name.short |
[logical] use short names for the output coefficients, e.g., omit the regression variable name when the same regression variable is used in all models. |
sep |
[character] character used to separate the name/outcome and the covariate when identifying the linear hypotheses. |
In presence of measurements from the same cluster across several models,
the influence function is used to estimate the covariance between the model parameters.
This is why the (robust) standard errors may not match the (model-based) standard error from the linear mixed
Setting the argument robust
to FALSE
when calling anova.lmm
will rescale the (robust) standard errors to mimic the original model-based standard errors.
## simulate data
set.seed(10)
dL <- sampleRem(1e2, n.times = 3, format = "long")
## estimate mixed models
e.lmm1 <- lmm(Y ~ X1+X2+X3, repetition = ~visit|id, data = dL,
structure = "CS", df = FALSE)
e.lmm2 <- lmm(Y ~ X1+X8+X9, repetition = ~visit|id, data = dL,
structure = "CS", df = FALSE)
## combine null hypotheses
## - model-based standard errors
AAA <- anova(e.lmm1, effect = c("X1|X2,X3"="X1=0","X2|X1,X3"="X2=0"), simplify = FALSE)
BBB <- anova(e.lmm2, effect = c("X1|X8,X9"="X1=0"), simplify = FALSE)
ZZZ <- rbind(AAA,BBB)
summary(ZZZ) ## adjusted for multiple testing
rbind(model.tables(e.lmm1)[2:3,], model.tables(e.lmm2)[2,,drop=FALSE])
## select null hypotheses & combine (model-based like standard errors)
AA <- anova(e.lmm1, effect = c("X1|X2,X3"="X1=0","X2|X1,X3"="X2=0"),
robust = TRUE, simplify = FALSE)
BB <- anova(e.lmm2, effect = c("X1|X8,X9"="X1=0"),
robust = TRUE, simplify = FALSE)
ZZ <- rbind(AA,BB)
summary(ZZ) ## adjusted for multiple testing
rbind(model.tables(e.lmm1, robust = TRUE)[2:3,],
model.tables(e.lmm2, robust = TRUE)[2,,drop=FALSE])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.