Class to house the latent random variables that govern toxicity and efficacy events in patients. Instances of this class can be used in simulation-like tasks to effectively use the same simulated individuals in different designs, thus supporting reduced Monte Carlo error and more efficient comparison.

References

Sweeting, M., Slade, D., Jackson, D., & Brock, K. (2024). Potential outcome simulation for efficient head-to-head comparison of adaptive dose-finding designs. arXiv preprint arXiv:2402.15460

Public fields

num_patients

(`integer(1)`)

tox_u

(`numeric(num_patients)`)

eff_u

(`numeric(num_patients)`)

can_grow

(`logical(1)`)

Methods


Method new()

Creator.

Usage

PatientSample$new(num_patients = 0)

Arguments

num_patients

(`integer(1)`).

Returns

[PatientSample].


Method set_eff_and_tox()

Set the toxicity and efficacy latent variables that govern occurrence of toxicity and efficacy events. By default, instances of this class automatically grow these latent variables to accommodate arbitrarily high sample sizes. However, when you set these latent variables manually via this function, you override the ability of the class to self-manage, so its ability to grow is turned off by setting the internal variable self$can_grow <- FALSE.

Usage

PatientSample$set_eff_and_tox(tox_u, eff_u)

Arguments

tox_u

(`numeric()`).

eff_u

(`numeric()`).


Method expand_to()

Expand sample to size at least num_patients

Usage

PatientSample$expand_to(num_patients)

Arguments

num_patients

(`integer(1)`).


Method get_tox_u()

Get toxicity latent variable for patient i

Usage

PatientSample$get_tox_u(i)

Arguments

i

(`integer(1)`) patient index


Method get_patient_tox()

Get 0 or 1 event marker for whether toxicity occurred in patient i

Usage

PatientSample$get_patient_tox(i, prob_tox)

Arguments

i

(`integer(1)`) patient index

prob_tox

(`numeric(1)`) probability of toxicity


Method get_eff_u()

Get efficacy latent variable for patient i

Usage

PatientSample$get_eff_u(i)

Arguments

i

(`integer(1)`) patient index


Method get_patient_eff()

Get 0 or 1 event marker for whether efficacy occurred in patient i

Usage

PatientSample$get_patient_eff(i, prob_eff)

Arguments

i

(`integer(1)`) patient index

prob_eff

(`numeric(1)`) probability of efficacy


Method clone()

The objects of this class are cloneable with this method.

Usage

PatientSample$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.