View source: R/mrct_simulation.R
| validate_mrct_data | R Documentation |
Checks that a dataset contains all required variables for MRCT simulation functions and reports any issues. Required variables include outcome (tte, event), treatment (treat), continuous covariates (age, bm), and factor covariates (male, histology, prior_treat, regA).
validate_mrct_data(df.case, verbose = TRUE)
df.case |
Data frame to validate |
verbose |
Logical. Print detailed validation results. Default: TRUE |
The function checks for the following variables:
Outcome: tte (time-to-event), event (0/1 indicator)
Treatment: treat (0/1 indicator)
Continuous: age, bm (biomarker)
Factor: male (0/1), histology, prior_treat (0/1), regA (0/1)
The function also validates variable types and value ranges.
Logical. TRUE if all requirements met, FALSE otherwise (invisibly)
create_dgm_for_mrct for creating DGM from validated data
## Not run:
# Check if dataset is ready for MRCT simulations
is_valid <- validate_mrct_data(df.case)
if (!is_valid) {
stop("Please fix data issues before running simulations")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.