Skip to contents

we remove a fraction of AEs from a specific site

Usage

sim_ur(df_visit, study_id, site_number, ur_rate)

Arguments

df_visit,

dataframe

study_id,

character

site_number,

character

ur_rate,

double

Details

we determine the absolute number of AEs per patient for removal. Then them remove them at the first visit. We intentionally allow fractions

Examples

df_visit <- sim_test_data_study(n_pat = 100, n_sites = 10,
                                 frac_site_with_ur = 0.4, ur_rate = 0.6)

df_visit$study_id <- "A"

df_ur <- sim_ur(df_visit, "A", site_number = "S0001", ur_rate = 0.35)

# Example cumulated AE for first patient with 35% under-reporting
df_ur[df_ur$site_number == "S0001" & df_ur$patnum == "P000001",]$n_ae
#>  [1] 0.0 0.6 0.6 1.6 1.6 1.6 1.6 1.6 1.6 2.6 2.6 2.6 2.6 2.6 2.6 2.6 2.6

# Example cumulated AE for first patient with no under-reporting
df_visit[df_visit$site_number == "S0001" & df_visit$patnum == "P000001",]$n_ae
#>  [1] 1 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4