View source: R/bayesian_cure_rate_model.R
compute_fdr_tpr | R Documentation |
This help function computes the achieved False Discovery Rate (FDR) and True Positive Rate (TPR). Useful for simulation studies where the ground truth classification of subjects in susceptibles and cured items is known.
compute_fdr_tpr(true_latent_status, posterior_probs,
myCut = c(0.01, 0.05, 0.1, 0.15))
true_latent_status |
a binary vector containing the true latent status: 1 should correspond to the positive instances ("cured") and 0 to the negative ("susceptibles"). |
posterior_probs |
a numeric vector with entries between 0 and 1 containing the scores (posterior probabilities) of being positive ("cured") for each item. |
myCut |
Vector containing the desired nominal FDR levels. |
This function will return for every nominal FDR level the following quantities:
achieved_fdr |
the achieved false discovery rate. |
tpr |
the true positive rate. |
nominal_fdr |
the nominal FDR level. |
Panagiotis Papastamoulis
set.seed(1)
v1 <- sample(0:1, size = 100, replace=TRUE, prob=c(0.8,0.2) )
v2 <- runif(100)
compute_fdr_tpr(true_latent_status = v1, posterior_probs = v2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.