# NOT RUN {
data(autism)
trainind <- which(batch %in% c(1,2))
Xtrain <- X[trainind,]
ytrain <- y[trainind]
batchtrain <- factor(as.numeric(batch[trainind]), levels=c(1,2))
testind <- which(batch %in% c(3,4))
Xtest <- X[testind,]
ytest <- y[testind]
batchtest <- as.numeric(batch[testind])
batchtest[batchtest==3] <- 1
batchtest[batchtest==4] <- 2
batchtest <- factor(batchtest, levels=c(1,2))
params <- combatba(x=Xtrain, batch=batchtrain)
Xtestaddon <- combatbaaddon(params, x=Xtest, batch=batchtest)
# }
Run the code above in your browser using DataLab