multTest: Test for Multiplicative Batch Effects

View source: R/multTest.R

multTestR Documentation

Test for Multiplicative Batch Effects

Description

multTest function will test for multiplicative batch effects in the residuals for each feature after fitting a linear mixed effects model. Uses Fligner-Killeen method for significance testing. Data should be in "long" format. Depends on lme4 package.

Usage

multTest(idvar, batchvar, features, formula, ranef, data, verbose = TRUE)

Arguments

idvar

character string that specifies name of ID variable. ID variable can be factor, numeric, or character.

batchvar

character string that specifies name of the batch variable. Batch variable should be a factor.

features

character string that specifies names of the numeric feature variables, or the numeric indices of the corresponding columns.

formula

character string representing all fixed effects on the right side of the formula for the linear mixed effects model. This should be in the notation used by lme4 and include covariates, time, and any interactions. For example, "age + sex + diagnosis*time" fits model with fixed effects age, sex, diagnosis, time, and the diagnosis*time interaction. Formula should NOT include batchvar and should NOT include random effects.

ranef

character string representing formula for the random effects in the notation used by lme4. For example, "(1|subid)" fits a random intercept for each unique idvar subid, and "(1 + time|subid)" fits a random intercept and random slope for each unique subid.

data

name of the data frame that contains the variables above. Rows are different observations (subject/timepoints), columns are different variables.

verbose

prints messages. Logical TRUE or FALSE. Default is TRUE.

Value

A data frame of Fligner-Killeen test results for each feature.


jcbeer/longCombat documentation built on June 26, 2022, 6:47 p.m.