R/sepscore.R

Defines functions sepscore

Documented in sepscore

sepscore <-
function(xba, batch, k=10) {

  allpairs <- combn(levels(batch), 2)

  sum(apply(allpairs, 2, function(y) (sum(batch==y[1]) + sum(batch==y[2]))*sepscoreTwo(xba[batch==y[1],], 
    xba[batch==y[2],], k=k))/(nrow(xba)*(length(levels(batch))-1)))

}

Try the bapred package in your browser

Any scripts or data that you put into this service are public.

bapred documentation built on June 22, 2022, 9:08 a.m.