simulate_accrual_data: Simulate accrual data

View source: R/simulate_trial_longitudinal.R

simulate_accrual_dataR Documentation

Simulate accrual data

Description

Simulate accrual data

Usage

simulate_accrual_data(
  nsubj = 200,
  accrual = function(n) round(cumsum(rexp(n, 3))),
  dropout = function(n) sample(c(1, Inf), n, replace = T, prob = c(0.2, 0.8))
)

Arguments

nsubj

The number of subjects

accrual

An accrual function which returns 'nsubj' ordered randomisation times in weeks

dropout

A drop-out function which returns 'nsubj' times-to-drop-out, one for each subject. 'Inf' means no drop-out (not implemented)

Value

A data.table giving the accrual data


jatotterdell/mfittrial documentation built on Sept. 30, 2022, 12:23 p.m.