Description Usage Arguments Examples
This is a helper function for OncoSigNB. Given a bin vector and the gold standard vector (i.e. the two vectors of the same length), return the Likelihood Ratio vector.
1 | getLRsgivenBin_info(bin_vector, the_bin, label_vector)
|
bin_vector |
|
the_bin |
|
label_vector |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (bin_vector, the_bin, label_vector)
{
the_bins_new = the_bin
bin_vector_new = bin_vector
prior = table(label_vector)[2]/table(label_vector)[1]
bin_vector_2 = unique(sort(bin_vector))
bin_vector_3 = rep(0, length(bin_vector_2))
for (i in 1:length(bin_vector_2)) {
the_num = bin_vector_2[i]
ratio_1 = table(label_vector[bin_vector == i])[2]/table(label_vector[bin_vector ==
i])[1]
LR = ratio_1/prior
bin_vector_3[i] = LR
}
names(bin_vector_3) = bin_vector_2
return(bin_vector_3)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.