View source: R/Harmonization.R
covfam | R Documentation |
Implementation of the CovBat Family of harmonization methods allowing for removal of multivariate batch effects, flexible covariate modeling and alternative estimators for site effect adjustment. Support for modeling of both location and scale via GAMLSS. Additional support for modeling of covariate effects in score location and scale.
covfam(
data,
bat,
covar = NULL,
model = lm,
formula = NULL,
score.model = NULL,
score.args = NULL,
eb = TRUE,
robust.LS = FALSE,
ref.batch = NULL,
percent.var = 0.95,
n.pc = NULL,
std.var = TRUE,
...
)
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 |
score.model |
Model for scores, defaults to NULL for fitting basic location and scale model without covariates on the scores |
score.args |
List of arguments for score model |
eb |
If |
robust.LS |
If |
ref.batch |
Reference batch, must take value in |
percent.var |
Numeric. The number of harmonized principal component scores is selected to explain this proportion of the variance |
n.pc |
Optional numeric. If specified, this number of principal
component scores is harmonized. Overrides |
std.var |
If |
... |
Additional arguments to |
covfam
returns a list containing the following components:
dat.covbat |
Harmonized data as a matrix with same dimensions as |
batch.info |
Batch information, including reference batch if specified |
combat.out |
List output of |
pc.output |
Output of |
n.pc |
Numeric, number of PCs harmonized |
scores.com |
List output of |
covfam(iris[,1:2], iris$Species)
covfam(iris[,1:2], iris$Species, iris[3:4], lm, y ~ Petal.Length + Petal.Width)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.