comfam {ComBatFamQC} | R Documentation |
ComBat Family Harmonization
Description
Implementation of the ComBat Family of harmonization methods allowing for flexible covariate modeling and alternative estimators for site effect adjustment. Support for modeling of both location and scale via GAMLSS and longitudinal harmonization via mixed effects models.
Usage
comfam(
data,
bat,
covar = NULL,
model = lm,
formula = NULL,
eb = TRUE,
robust.LS = FALSE,
ref.batch = NULL,
...
)
Arguments
data |
n x p data frame or matrix of observations where p is the number of features and n is the number of subjects. |
bat |
Factor indicating batch (often equivalent to site or scanner) |
covar |
Data frame or matrix of covariates supplied to |
model |
Model function. ComBat Family supports any models that take
arguments |
formula |
Formula for |
eb |
If |
robust.LS |
If |
ref.batch |
Reference batch, must take value in |
... |
Additional arguments to |
Value
comfam
returns a list containing the following components:
dat.combat |
Harmonized data as a matrix with same dimensions as |
batch.info |
Batch information, including reference batch if specified |
fits |
List of model fits from regression step, outputs of |
estimates |
List of estimates from standardization and batch effect correction |
See Also
predict.comfam for applying ComBat parameters for harmonization of new observations
Examples
comfam(iris[,1:2], iris$Species)
comfam(iris[,1:2], iris$Species, iris[3:4], lm, y ~ Petal.Length + Petal.Width)