2929# ' with the outcome (i.e., true signal features).
3030# ' @param noise_parameters Integer. Number of candidate predictors not
3131# ' associated with the outcome (noise features). Default is 0.
32- # ' @param predictor_type Character string, either `"continuous"` or `"binary"` .
33- # ' Specifies the type of simulated candidate predictors. Defaults to `"continuous"`.
32+ # ' @param predictor_type Character string, currently only `"continuous"` supported, which is the default option .
33+ # ' Specifies the type of simulated candidate predictors.
3434# ' @param binary_predictor_prevalence Optional numeric in (0, 1). Prevalence of
3535# ' the binary predictors when `predictor_type = "binary"`. Ignored otherwise.
3636# ' @param outcome_prevalence Numeric in (0, 1). Target prevalence of the binary
7878# ' }
7979# ' @export
8080simulate_binary <- function (
81- signal_parameters , # Predictors
81+ signal_parameters , # Predictors
8282 noise_parameters = 0 ,
83- predictor_type = c(" continuous" , " binary " ),
83+ predictor_type = c(" continuous" ),
8484 binary_predictor_prevalence = NULL ,
85- outcome_prevalence , # Outcome
85+ outcome_prevalence , # Outcome
8686 large_sample_cstatistic ,
87- model = c(" glm" ), # Model
87+ model = c(" glm" ), # Model
8888 metric = c(" calibration_slope" , " auc" ), # Performance
8989 minimum_acceptable_performance ,
90- n_reps_total = 1000 , # Engine control
90+ n_reps_total = 1000 , # Engine control
9191 mean_or_assurance = c(" assurance" , " mean" ),
9292 ...
9393) {
94- predictor_type <- match.arg (predictor_type )
95- model <- match.arg (model )
96- metric <- match.arg (metric )
97- mean_or_assurance <- match.arg (mean_or_assurance )
94+ predictor_type <- check_pmsims_args (predictor_type )
95+ model <- check_pmsims_args (model )
96+ metric <- check_pmsims_args (metric )
97+ mean_or_assurance <- check_pmsims_args (mean_or_assurance )
9898
9999 validate_metric_constraints(
100100 metric = metric ,
@@ -206,7 +206,7 @@ simulate_binary <- function(
206206simulate_continuous <- function (
207207 signal_parameters ,
208208 noise_parameters = 0 ,
209- predictor_type = c(" continuous" , " binary " ),
209+ predictor_type = c(" continuous" ),
210210 binary_predictor_prevalence = NULL ,
211211 large_sample_rsquared ,
212212 model = c(" lm" ),
@@ -216,10 +216,10 @@ simulate_continuous <- function(
216216 mean_or_assurance = c(" assurance" , " mean" ),
217217 ...
218218) {
219- predictor_type <- match.arg (predictor_type )
220- model <- match.arg (model )
221- metric <- match.arg (metric )
222- mean_or_assurance <- match.arg (mean_or_assurance )
219+ predictor_type <- check_pmsims_args (predictor_type )
220+ model <- check_pmsims_args (model )
221+ metric <- check_pmsims_args (metric )
222+ mean_or_assurance <- check_pmsims_args (mean_or_assurance )
223223
224224 validate_metric_constraints(
225225 metric = metric ,
@@ -329,7 +329,7 @@ simulate_continuous <- function(
329329simulate_survival <- function (
330330 signal_parameters ,
331331 noise_parameters = 0 ,
332- predictor_type = c(" continuous" , " binary " ),
332+ predictor_type = c(" continuous" ),
333333 binary_predictor_prevalence = NULL ,
334334 large_sample_cindex ,
335335 baseline_hazard = 1 ,
@@ -341,10 +341,10 @@ simulate_survival <- function(
341341 mean_or_assurance = c(" assurance" , " mean" ),
342342 ...
343343) {
344- predictor_type <- match.arg (predictor_type )
345- model <- match.arg (model )
346- metric <- match.arg (metric )
347- mean_or_assurance <- match.arg (mean_or_assurance )
344+ predictor_type <- check_pmsims_args (predictor_type )
345+ model <- check_pmsims_args (model )
346+ metric <- check_pmsims_args (metric )
347+ mean_or_assurance <- check_pmsims_args (mean_or_assurance )
348348
349349 validate_metric_constraints(
350350 metric = metric ,
0 commit comments