Correct under-reporting probabilities using p.adjust
.
Arguments
- df_sim_sites
dataframe generated by
sim_sites
orsim_inframe()
- method
character, passed to stats::p.adjust(), if NULL no multiplicity correction will be made.
- under_only
Logical, compute under-reporting probabilities only. only applies to the classic algorithm in which a one-sided evaluation can save computation time. Default: FALSE
- visit_med75
Logical, should evaluation point visit_med75 be used. Compatible with inframe and classic version of the algorithm. Default: FALSE
- ...
use to pass r_sim_sites parameter to eval_sites_deprecated()
Value
dataframe with the following columns:
- study_id
study identification
- site_number
site identification
- visit_med75
median(max(visit)) * 0.75
- mean_ae_site_med75
mean AE at visit_med75 site level
- mean_ae_study_med75
mean AE at visit_med75 study level
- pval
p-value as returned by
poisson.test
- prob
bootstrapped probability
Examples
df_visit <- sim_test_data_study(
n_pat = 100,
n_sites = 5,
ratio_out = 0.4,
factor_event_rate = 0.6
) %>%
# internal functions require internal column names
dplyr::rename(
n_ae = n_event,
site_number = site_id,
patnum = patient_id
)
df_site <- site_aggr(df_visit)
df_sim_sites <- sim_sites(df_site, df_visit, r = 100)
df_eval <- eval_sites(df_sim_sites)
df_eval
#> # A tibble: 5 × 10
#> study_id site_number n_pat n_pat_with_med75 visit_med75 mean_ae_site_med75
#> <chr> <chr> <int> <dbl> <int> <dbl>
#> 1 A S0001 20 17 16 20.8
#> 2 A S0002 20 18 15 18.6
#> 3 A S0003 20 19 14 11.1
#> 4 A S0004 20 19 17 11.9
#> 5 A S0005 20 16 17 11.8
#> # ℹ 4 more variables: mean_ae_study_med75 <dbl>, n_pat_with_med75_study <int>,
#> # pval <dbl>, prob <dbl>