simaerep | R Documentation |
Simulate AE under-reporting probabilities.
simaerep(
df_visit,
r = 1000,
check = TRUE,
under_only = TRUE,
visit_med75 = TRUE,
inframe = FALSE,
progress = TRUE,
mult_corr = TRUE,
param_site_aggr = list(method = "med75_adj", min_pat_pool = 0.2),
param_sim_sites = list(r = 1000, poisson_test = FALSE, prob_lower = TRUE),
param_eval_sites = list(method = "BH"),
env = parent.frame()
)
df_visit |
Data frame with columns: study_id, site_number, patnum, visit, n_ae. |
r |
Integer or tbl_object, number of repetitions for bootstrap simulation. Pass a tbl object referring to a table with one column and as many rows as desired repetitions. Default: 1000. |
check |
Logical, perform data check and attempt repair with
|
under_only |
Logical, compute under-reporting probabilities only.
Supersedes under_only parameter passed to |
visit_med75 |
Logical, should evaluation point visit_med75 be used. Default: TRUE. |
inframe |
Logical, only table operations to be used; does not require visit_med75. Compatible with dbplyr supported database backends. |
progress |
Logical, display progress bar. Default: TRUE. |
mult_corr |
Logical, multiplicity correction, Default: TRUE |
param_site_aggr |
List of parameters passed to |
param_sim_sites |
List of parameters passed to |
param_eval_sites |
List of parameters passed to |
env |
Optional, provide environment of original visit data. Default: parent.frame(). |
Executes site_aggr()
, sim_sites()
, and eval_sites()
on original
visit data and stores all intermediate results. Stores lazy reference to
original visit data for facilitated plotting using generic plot(x).
A simaerep object.
site_aggr()
, sim_sites()
, eval_sites()
, orivisit()
,
plot.simaerep()
site_aggr(), sim_sites(), eval_sites(), orivisit(), plot.simaerep()
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"
aerep <- simaerep(df_visit)
aerep
str(aerep)
# In-frame table operations
simaerep(df_visit, inframe = TRUE, visit_med75 = FALSE, under_only = FALSE)$df_eval
simaerep(df_visit, inframe = TRUE, visit_med75 = TRUE, under_only = FALSE)$df_eval
# Database example
con <- DBI::dbConnect(duckdb::duckdb(), dbdir = ":memory:")
df_r <- tibble::tibble(rep = seq(1, 1000))
dplyr::copy_to(con, df_visit, "visit")
dplyr::copy_to(con, df_r, "r")
tbl_visit <- dplyr::tbl(con, "visit")
tbl_r <- dplyr::tbl(con, "r")
simaerep(tbl_visit, r = tbl_r, inframe = TRUE, visit_med75 = FALSE, under_only = FALSE)$df_eval
simaerep(tbl_visit, r = tbl_r, inframe = TRUE, visit_med75 = TRUE, under_only = FALSE)$df_eval
DBI::dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.