Learn R Programming

simaerep (version 0.7.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,
  frac_site_with_ur = 0.4,
  ur_rate = 0.6
)

df_visit$study_id <- "A"

df_site <- site_aggr(df_visit)

df_pat_pool <- pat_pool(df_visit, df_site)

df_pat_pool

Run the code above in your browser using DataLab