Skip to contents

Internal function that simulates subject enrollment data with random allocation to treatment arms and inclusion dates.

Usage

example_enrol(N, seed, r = 0.5, r2 = 1/3, ...)

Arguments

N

Integer. Number of subjects to simulate.

seed

Integer. Random seed for reproducibility (can be NULL).

r

Numeric. Proportion of subjects allocated to the Control group in the binary arm variable (default: 0.5).

r2

Numeric. Proportion of subjects allocated to the Control group in the ternary arm3 variable (default: 1/3).

...

Additional arguments (currently unused).

Value

A tibble with N rows and the following columns:

  • subjid: Subject ID

  • arm: Two-arm treatment group ("Control" or "Treatment")

  • arm3: Three-arm treatment group ("Control", "Treatment A", "Treatment B")

  • date_inclusion: Inclusion date, spaced by 20 days plus an uniform jitter