dot-getCutoff: Find cutoff to transform abundance values into binary values

Description Usage Arguments Examples

Description

This function finds the best cutoff to transform abundance values into binary values while optimising sensitivity and specificity values based on observations

Usage

1
.getCutoff(Obs, Fit)

Arguments

Obs

a vector containing binary observed values (0 or 1)

Fit

a vector containing relative abundance values (between 0 and 1)

Examples

1
2
3
4
5
6
7
vec.obs = c(rep(0, 60), rep(1, 40))
vec.pred = c(sample(x = seq(0, 0.2, 0.01), size = 50, replace = TRUE)
             , sample(x = seq(0.15, 1, 0.01), size = 50, replace = TRUE))
## plot(vec.obs, vec.pred)

cutoff = .getCutoff(Obs = vec.obs, Fit = vec.pred)
str(cutoff)

MayaGueguen/RFate documentation built on Oct. 17, 2020, 8:06 a.m.