X-Git-Url: https://code.communitydata.science/ml_measurement_error_public.git/blobdiff_plain/d8bc08f18f8c2128369ee959196e0e6080a11689..69948cae1e691191fc86e6abdaa485bc98f38f1f:/simulations/02_indep_differential.R diff --git a/simulations/02_indep_differential.R b/simulations/02_indep_differential.R index 80e19be..9c33be7 100644 --- a/simulations/02_indep_differential.R +++ b/simulations/02_indep_differential.R @@ -141,7 +141,7 @@ parser <- add_argument(parser, "--y_bias", help='coefficient of y on the probabi parser <- add_argument(parser, "--z_bias", help='coefficient of z on the probability a classification is correct', default=0) parser <- add_argument(parser, "--truth_formula", help='formula for the true variable', default="x~z") parser <- add_argument(parser, "--Px", help='base rate of x', default=0.5) - +parser <- add_argument(parser, "--confint_method", help='method for approximating confidence intervals', default='quad') args <- parse_args(parser) B0 <- 0 @@ -159,9 +159,9 @@ if(args$m < args$N){ ## pc.df <- pc(suffStat=list(C=cor(df.pc),n=nrow(df.pc)),indepTest=gaussCItest,labels=names(df.pc),alpha=0.05) ## plot(pc.df) - result <- list('N'=args$N,'m'=args$m,'B0'=B0,'Bxy'=Bxy, 'Bzx'=args$Bzx, 'Bzy'=Bzy, 'Px'=Px, .'seed'=args$seed, 'y_explained_variance'=args$y_explained_variance, 'prediction_accuracy'=args$prediction_accuracy, 'accuracy_imbalance_difference'=args$accuracy_imbalance_difference, 'y_bias'=args$y_bias,'outcome_formula'=args$outcome_formula, 'proxy_formula'=args$proxy_formula,truth_formula=args$truth_formula, error='') + result <- list('N'=args$N,'m'=args$m,'B0'=B0,'Bxy'=Bxy, 'Bzx'=args$Bzx, 'Bzy'=Bzy, 'Px'=Px, 'seed'=args$seed, 'y_explained_variance'=args$y_explained_variance, 'prediction_accuracy'=args$prediction_accuracy, 'accuracy_imbalance_difference'=args$accuracy_imbalance_difference, 'y_bias'=args$y_bias,'outcome_formula'=args$outcome_formula, 'proxy_formula'=args$proxy_formula,truth_formula=args$truth_formula, confint_method=args$confint_method, error='') - outline <- run_simulation(df, result, outcome_formula=as.formula(args$outcome_formula), proxy_formula=as.formula(args$proxy_formula), truth_formula=as.formula(args$truth_formula)) + outline <- run_simulation(df, result, outcome_formula=as.formula(args$outcome_formula), proxy_formula=as.formula(args$proxy_formula), truth_formula=as.formula(args$truth_formula),confint_method=args$confint_method) outfile_lock <- lock(paste0(args$outfile, '_lock'),exclusive=TRUE)