View source: R/aipw_ccombat_helpers.R
cb.correct.apply_aipw_cComBat | R Documentation |
This function applies an Augmented Inverse Probability Weighting (AIPW) ComBat model for batch effect correction to new data.
cb.correct.apply_aipw_cComBat(Ys, Ts, Xs, Model)
Ys |
an |
Ts |
|
Xs |
|
Model |
a list containing the following parameters:
This model is output after fitting with |
Note: This function is experimental, and has not been tested on real data. It has only been tested with simulated data with binary (0 or 1) exposures.
an [n, d]
matrix, the batch-effect corrected data.
library(causalBatch)
sim <- cb.sims.sim_linear(a=-1, n=200, err=1/8, unbalancedness=3)
# fit batch effect correction for first 100 samples
cb.fit <- cb.correct.matching_cComBat(sim$Ys[1:100,,drop=FALSE], sim$Ts[1:100],
data.frame(Covar=sim$Xs[1:100,,drop=FALSE]), "Covar")
# apply to all samples
cor.dat <- cb.correct.apply_cComBat(sim$Ys, sim$Ts, data.frame(Covar=sim$Xs), cb.fit$Model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.