case_control_sampling_trials | R Documentation |
Perform case-control sampling of expanded data to create a data set of reduced size and calculate sampling weights
to be used in trial_msm()
.
case_control_sampling_trials(
data_prep,
p_control = NULL,
subset_condition,
sort = FALSE
)
data_prep |
Result from |
p_control |
Control sampling probability for selecting potential controls at each follow-up time of each trial. |
subset_condition |
Expression used to |
sort |
Sort data before applying case-control sampling to make sure that the resulting data are identical when
sampling from the expanded data created with |
A data.frame
or a split()
data.frame
if length(p_control) > 1
. An additional column sample_weight
containing the sample weights will be added to the result. These can be included in the models fit with
trial_msm()
.
# If necessary reduce the number of threads for data.table
data.table::setDTthreads(2)
data("te_data_ex")
samples <- case_control_sampling_trials(te_data_ex, p_control = 0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.