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

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

Author

Damien Georges

Examples


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)