sim_sites | R Documentation |
Collects the number of AEs of all eligible patients that meet visit_med75 criteria of site. Then calculates poisson.test pvalue and bootstrapped probability of having a lower mean value.
sim_sites(
df_site,
df_visit,
r = 1000,
poisson_test = TRUE,
prob_lower = TRUE,
progress = TRUE,
check = TRUE,
under_only = TRUE
)
df_site |
dataframe created by |
df_visit |
dataframe, created by |
r |
integer, denotes number of simulations, default = 1000 |
poisson_test |
logical, calculates poisson.test pvalue |
prob_lower |
logical, calculates probability for getting a lower value |
progress |
logical, display progress bar, Default = TRUE |
check |
logical, perform data check and attempt repair with |
under_only |
compute under-reporting probabilities only, default = TRUE check_df_visit(), computationally expensive on large data sets. Default: TRUE |
dataframe with the following columns:
study identification
site identification
number of patients at site
median(max(visit)) * 0.75
number of patients at site with med75
mean AE at visit_med75 site level
mean AE at visit_med75 study level
number of patients at study with med75 excl. site
p-value as returned by poisson.test
bootstrapped probability for having mean_ae_site_med75 or lower
sim_sites
,
site_aggr
,
pat_pool
,
prob_lower_site_ae_vs_study_ae
,
poiss_test_site_ae_vs_study_ae
,
sim_sites
,
prep_for_sim
df_visit <- sim_test_data_study(
n_pat = 100,
n_sites = 5,
frac_site_with_ur = 0.4,
ur_rate = 0.2
)
df_visit$study_id <- "A"
df_site <- site_aggr(df_visit)
df_sim_sites <- sim_sites(df_site, df_visit, r = 100)
df_sim_sites %>%
knitr::kable(digits = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.