Skip to contents

Sample a desired number of trajectories at arm leven and for individual patients.

Internal function that shouldn't really be invoked by the user directly. The arguments given must be named vectors.

Usage

sample_example_trajectories(scenario, ...)

# S3 method for hrqolr_scenario
sample_example_trajectories(
  scenario,
  n_example_trajectories_per_arm = 50,
  n_digits = 2,
  seed = NULL,
  valid_hrqol_range = c(-0.757, 1),
  ...
)

# S3 method for default
sample_example_trajectories(
  arms,
  sampling_frequency,
  index_hrqol,
  first_hrqol,
  final_hrqol,
  acceleration_hrqol,
  mortality,
  prop_mortality_benefitters,
  mortality_trajectory_shape,
  mortality_dampening,
  n_example_trajectories_per_arm,
  n_digits,
  seed = NULL,
  valid_hrqol_range,
  ...
)

Arguments

scenario

object of class 'hrqolr_scenario', the output of setup_scenario

...

passed on to methods

n_example_trajectories_per_arm

single integer, the number of example trajectories to include in the returned object

n_digits

single integer, the number of decimal places of in the first HRQoL values of patients. More digits will yield greater precision but also cause longer run-times.

seed

single integer, optional seed for reproducible pseudo-random number generation. Defaults to a deterministic value based on the arguments given (ensuring reproducibility by default).

valid_hrqol_range

two-element numeric vector, the lower and upper bounds of valid HRQoL values. The default (c(-0.757, 1.0)) corresponds to the Danish EQ-5D-5L index values.

Value

An object of class hrqolr_trajectories with trajectories in data.tables. The function will always return arm-level trajectories. If n_example_trajectories_per_arm > 0, it will also return data.table with patient trajectories, with a id column denoting patients.