Learn R Programming

simaerep (version 1.0.0)

pat_pool: Create a study specific patient pool for sampling

Description

Internal function for sim_sites, filter all visits greater than max_visit_med75_study returns dataframe with one column for studies and one column with nested patient data.

Usage

pat_pool(df_visit, df_site)

Value

dataframe with nested pat_pool column

Arguments

df_visit

dataframe, created by sim_sites

df_site

dataframe created by site_aggr

Examples

Run this code
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_pat_pool <- simaerep:::pat_pool(df_visit, df_site)

df_pat_pool

Run the code above in your browser using DataLab