]> code.communitydata.science - ml_measurement_error_public.git/blobdiff - simulations/02_indep_differential.R
update simulation base from hyak
[ml_measurement_error_public.git] / simulations / 02_indep_differential.R
index 80e19be78f8badbad9eb3e557ea6de5a356da384..9c33be717f0a2169c9eb2bd19d35204ea0a3fa53 100644 (file)
@@ -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)

Community Data Science Collective || Want to submit a patch?