getLRsgivenBin_info: Return vector of Likelihood Ratios for each bin.

Description Usage Arguments Examples

Description

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.

Usage

1
getLRsgivenBin_info(bin_vector, the_bin, label_vector)

Arguments

bin_vector
the_bin
label_vector

Examples

 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)
  }

califano-lab/OncoSig documentation built on Oct. 2, 2020, 3:24 p.m.