mt.test: Multiple Student's t-Test

View source: R/mt.test.R

mt.testR Documentation

Multiple Student's t-Test

Description

Perform multiple Student's t-Test via heteroschedastic linear regression and combine the results, possibly adjusted for multiplicity.

Usage

mt.test(formula, data, method = NULL, level = 0.95, trace = TRUE)

Arguments

formula

A formula like Y1+Y2+Y3~X|id with:

  • the outcome on the left hand side (separated with +)

  • the group variable on the right hand side

  • a variable identifying each line in the dataset (optional)

data

dataset in the wide format. Should inherit from data.frame.

method

[character] type of adjustment for multiple comparisons, one of "none", "bonferroni", ..., "fdr", "single-step", "single-step2". See confint.Wald_lmm for more details. By default "single-step" when the test statistics have equal degrees of freedom and otherwise "single-step2".

level

[numeric,0-1] the confidence level of the confidence intervals.

trace

[logical] should a message be displayed in the console when there are missing data.

Details

In presence of missing values, performs a outcome specific complete case analysis.

Value

A data.frame with the estimates, confidence intervals, and p-values relative to each outcome. Depending on the argument method confidence intervals and p-values may be adjusted for multiple comparisons. The data.frame has an attribute mlmm containing the underlying regression models.

Examples

data(calciumW, package = "LMMstar")

t.test(bmd1 ~ grp, data = calciumW)

mt.test(bmd1+bmd2+bmd3+bmd4+bmd5 ~ grp, data = calciumW)
mt.test(bmd1+bmd2+bmd3+bmd4+bmd5 ~ grp|girl, data = calciumW)
mt.test(bmd1+bmd2+bmd3+bmd4+bmd5 ~ grp|girl, data = calciumW, method = "none")

LMMstar documentation built on Nov. 9, 2023, 1:06 a.m.