Learn R Programming

simaerep (version 1.0.0)

sim_out: simulate under-reporting

Description

we remove a fraction of events from a specific site

Usage

sim_out(df_visit, study_id, site_id, factor_event)

Arguments

df_visit,

dataframe

study_id,

character

site_id,

character

factor_event,

double, negative values for under-reporting positive for for over-reporting.

Details

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

Examples

Run this code
df_visit <- sim_test_data_study(n_pat = 100, n_sites = 10)


df_ur <- sim_out(df_visit, "A", site_id = "S0001", factor_event = - 0.35)

# Example cumulated event for first patient with 35% under-reporting
df_ur[df_ur$site_id == "S0001" & df_ur$patient_id == "P000001",]$n_event

# Example cumulated event for first patient with no under-reporting
df_visit[df_visit$site_id == "S0001" & df_visit$patient_id == "P000001",]$n_event

Run the code above in your browser using DataLab