Correct under-reporting probabilities by the expected number of
false positives (fp). This has been deprecated in favor of more conventional
methods available via p.adjust
.
eval_sites_deprecated(df_sim_sites, r_sim_sites)
dataframe generated by sim_sites()
integer, number of repeats for bootstrap resampling for site simulation, needed for zero probability correction for fp calculation, Default: 1000
dataframe with the following columns:
study identification
site identification
median(max(visit)) * 0.75
mean AE at visit_med75 site level
mean AE at visit_med75 study level
p-value as returned by poisson.test
bootstrapped probability for having mean_ae_site_med75 or lower
number of study sites
sites with the same p-value or lower
expected number of fp, pval * n_site
odds under-reporting as p/fp, poisson.test (use as benchmark)
probability under-reporting as 1 - fp/p, poisson.test (use as benchmark)
sites with same bootstrapped probability or lower
expected number of fp, prob_lower * n_site
odds under-reporting as p/fp, bootstrapped (use)
probability under-reporting as 1 - fp/p, bootstrapped (use)
If by chance expected number of false positives (fp) is greater than the total number of positives (p) we set p_vs_fp_ratio = 1 and prob_ur = 0.
df_visit <- sim_test_data_study(n_pat = 100, n_sites = 5,
frac_site_with_ur = 0.4, ur_rate = 0.6)
df_visit$study_id <- "A"
df_site <- site_aggr(df_visit)
df_sim_sites <- sim_sites(df_site, df_visit, r = 100)
df_eval <- eval_sites_deprecated(df_sim_sites, r_sim_sites = 100)
df_eval
#> # A tibble: 5 × 19
#> study_id site_number n_pat n_pat_with_med75 visit_med75 mean_ae_site_med75
#> <chr> <chr> <int> <int> <dbl> <dbl>
#> 1 A S0002 20 17 18 3.94
#> 2 A S0001 20 18 16 3.39
#> 3 A S0003 20 18 17 10.2
#> 4 A S0004 20 18 14 7.28
#> 5 A S0005 20 17 15 7.29
#> # ℹ 13 more variables: mean_ae_study_med75 <dbl>, n_pat_with_med75_study <int>,
#> # pval <dbl>, prob_low <dbl>, n_site <int>, pval_n_detected <int>,
#> # pval_fp <dbl>, pval_p_vs_fp_ratio <dbl>, pval_prob_ur <dbl>,
#> # prob_low_n_detected <int>, prob_low_fp <dbl>, prob_low_p_vs_fp_ratio <dbl>,
#> # prob_low_prob_ur <dbl>