set_event_number: Adjusts simulations so that administrative censoring occurs...

Description Usage Arguments Value Author(s) Examples

View source: R/simulation_functions.R

Description

Function for converting trials simulated by simulate_trials() or simulate_trials_strata() from a fixed censoring time to a fixed number of total events.
It is set up to automatically read in either matrix or list formats from simulate_trials() or simulate_trials_strata(), and only these inputs are supported.
Note that if recruitment had not finished in the input then any increases in assessment time cannot account for the missing patients. It is therefore strongly recommended to initially simulate for at least the duration of the recruitment before fixing the event number.
This function can also be used to change format and/or slim down data for event-driven simulations.

Usage

1
2
3
4
5
6
set_event_number(
  data,
  events,
  output_type = c("input", "matrix", "list"),
  detailed_output = TRUE
)

Arguments

data

Output file from simulate_trials() or simulate_trials_strata() in either "list" or "matrix" format. Only these formats are supported.

events

Positive integer specifying the required number of events.

output_type

Choice of "input" (output in same format as input),"matrix" (matrix format output) or "list" (list format output). Default="input".

detailed_output

Boolean to require full details of timings of competing processes. If FALSE, the simplified data only includes the *'ed output columns - this approximately halves RAM requirements. Default=TRUE (detailed).

Value

Returns the input simulated trial, in either matrix or list format, with modified assessment times. All columns dependent on this are also updated.

Author(s)

James Bell

Examples

1
2
3
4
example_sim <- simulate_trials(active_ecurve=Weibull(250,0.8),control_ecurve=Weibull(100,1),
rcurve=LinearR(12,100,100), assess=20,iterations=5,seed=12345,detailed_output=TRUE)

adjusted_examples <- set_event_number(data=example_sim,events=50)

gestate documentation built on Feb. 20, 2020, 5:08 p.m.