sim_sites {simaerep} | R Documentation |
Calculate prob_lower and poisson.test pvalue for study sites.
Description
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.
Usage
sim_sites(
df_site,
df_visit,
r = 1000,
poisson_test = TRUE,
prob_lower = TRUE,
progress = TRUE,
check = TRUE,
under_only = TRUE
)
Arguments
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 |
Value
dataframe with the following columns:
- study_id
study identification
- site_number
site identification
- n_pat
number of patients at site
- visit_med75
median(max(visit)) * 0.75
- n_pat_with_med75
number of patients at site with med75
- mean_ae_site_med75
mean AE at visit_med75 site level
- mean_ae_study_med75
mean AE at visit_med75 study level
- n_pat_with_med75_study
number of patients at study with med75 excl. site
- pval
p-value as returned by
poisson.test
- prob_low
bootstrapped probability for having mean_ae_site_med75 or lower
See Also
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
Examples
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)