diff --git a/simulations/missing-data-benchmarks/R/meals/meal-extreme-missingness-SAS.R b/simulations/missing-data-benchmarks/R/meals/meal-extreme-missingness-SAS.R index 9f8aa87a0..d52a3d3e6 100644 --- a/simulations/missing-data-benchmarks/R/meals/meal-extreme-missingness-SAS.R +++ b/simulations/missing-data-benchmarks/R/meals/meal-extreme-missingness-SAS.R @@ -3,6 +3,8 @@ ################################################################################ # load required libraries +library(reticulate) +use_virtualenv("daniel") library(simChef) library(mmrm) library(glmmTMB) @@ -19,7 +21,7 @@ library(microbenchmark) # source the R scripts sim_functions_files <- list.files( - c("R/dgp", "R/method", "R/eval", "R/viz"), + c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"), pattern = "*.R$", full.names = TRUE, ignore.case = TRUE ) sapply(sim_functions_files, source) @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix() toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6))) # set the sample size -n_obs <- 600 +n_obs <- 200 # dgps with no treatment effect no_effect_us_dgp <- create_dgp( @@ -157,8 +159,8 @@ type_2_error_rate_eval <- create_evaluator( # create the experiment experiment <- create_experiment( - name = "mmrm-benchmark-extreme-missingness-n-600-SAS", - save_dir = "results/extreme-miss/n-600-SAS" + name = glue::glue("mmrm-benchmark-extreme-missingness-n-{n_obs}-SAS"), + save_dir = glue::glue("results/extreme-miss/n-{n_obs}-SAS") ) %>% add_dgp(no_effect_us_dgp, name = "no_effect_us") %>% add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>% @@ -188,32 +190,30 @@ experiment <- create_experiment( add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>% add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate") -# # Determine host name -# hostname <- "sabanesd-nwpfwh-eu.ocean" -# -# # Do this to register host -# session <- ssh::ssh_connect(hostname) -# ssh_disconnect(session) -# -# # We can also be specific if there are multiple SAS containers we want to connect to. -# cfg_name <- "~/sascfg_personal.py" -# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) -# options(sascfg = cfg_name) -# -# # Test if it works. -# df <- data.frame(a = 1, b = 2) -# sasr::df2sd(df) +# Determine host name +hostname <- "sabanesd-w2yc52-eu.ocean" -# run the experiment -# set.seed(713452) -# results <- experiment$run( -# n_reps = 1000, -# save = TRUE, -# verbose = 2, -# checkpoint_n_reps = 10 -# ) +# Do this to register host +session <- ssh::ssh_connect(hostname) +ssh_disconnect(session) -source("R/format-replicate-results/helpers.R") +# We can also be specific if there are multiple SAS containers we want to connect to. +cfg_name <- "~/sascfg_personal.py" +sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) +options(sascfg = cfg_name) -format_fit_and_save(experiment) +# Test if it works. +df <- data.frame(a = 1, b = 2) +sasr::df2sd(df) +# run the experiment +set.seed(713452) +results <- experiment$run( + n_reps = 1000, + save = TRUE, + use_cached = TRUE, + verbose = 2, + checkpoint_n_reps = 100 +) + +format_fit_and_save(experiment) diff --git a/simulations/missing-data-benchmarks/R/meals/meal-high-missingness-SAS.R b/simulations/missing-data-benchmarks/R/meals/meal-high-missingness-SAS.R index 9596b2974..528d01710 100644 --- a/simulations/missing-data-benchmarks/R/meals/meal-high-missingness-SAS.R +++ b/simulations/missing-data-benchmarks/R/meals/meal-high-missingness-SAS.R @@ -3,6 +3,8 @@ ################################################################################ # load required libraries +library(reticulate) +use_virtualenv("daniel") library(simChef) library(mmrm) library(glmmTMB) @@ -19,7 +21,7 @@ library(microbenchmark) # source the R scripts sim_functions_files <- list.files( - c("R/dgp", "R/method", "R/eval", "R/viz"), + c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"), pattern = "*.R$", full.names = TRUE, ignore.case = TRUE ) sapply(sim_functions_files, source) @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix() toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6))) # set the sample size -n_obs <- 600 +n_obs <- 200 # dgps with no treatment effect no_effect_us_dgp <- create_dgp( @@ -157,8 +159,8 @@ type_2_error_rate_eval <- create_evaluator( # create the experiment experiment <- create_experiment( - name = "mmrm-benchmark-high-missingness-n-600-SAS", - save_dir = "results/high-miss/n-600-SAS" + name = glue::glue("mmrm-benchmark-high-missingness-n-{n_obs}-SAS"), + save_dir = glue::glue("results/high-miss/n-{n_obs}-SAS") ) %>% add_dgp(no_effect_us_dgp, name = "no_effect_us") %>% add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>% @@ -188,31 +190,29 @@ experiment <- create_experiment( add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>% add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate") -# # Input here the name of the SAS container. -# hostname <- "sabanesd-k2n72p-eu.ocean" -# -# # Do this to register host -# session <- ssh::ssh_connect(hostname) -# ssh_disconnect(session) -# -# # We can also be specific if there are multiple SAS containers we want to connect to. -# cfg_name <- "sascfg_personal_2.py" -# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) -# options(sascfg = cfg_name) -# -# # Test if it works. -# df <- data.frame(a = 1, b = 2) -# sasr::df2sd(df) +# Input here the name of the SAS container. +hostname <- "sabanesd-k2lza0-eu.ocean" -# run the experiment -# set.seed(713452) -# results <- experiment$run( -# n_reps = 1000, -# save = TRUE, -# verbose = 2, -# checkpoint_n_reps = 10 -# ) +# Do this to register host +session <- ssh::ssh_connect(hostname) +ssh_disconnect(session) + +# We can also be specific if there are multiple SAS containers we want to connect to. +cfg_name <- "sascfg_personal_3.py" +sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) +options(sascfg = cfg_name) -source("R/format-replicate-results/helpers.R") +# Test if it works. +df <- data.frame(a = 1, b = 2) +sasr::df2sd(df) + +# run the experiment +set.seed(235234) +results <- experiment$run( + n_reps = 1000, + save = TRUE, + verbose = 2, + checkpoint_n_reps = 100 +) format_fit_and_save(experiment) diff --git a/simulations/missing-data-benchmarks/R/meals/meal-low-missingness-SAS.R b/simulations/missing-data-benchmarks/R/meals/meal-low-missingness-SAS.R index 2ac74258a..106bc41ff 100644 --- a/simulations/missing-data-benchmarks/R/meals/meal-low-missingness-SAS.R +++ b/simulations/missing-data-benchmarks/R/meals/meal-low-missingness-SAS.R @@ -3,6 +3,8 @@ ################################################################################ # load required libraries +library(reticulate) +use_virtualenv("daniel") library(simChef) library(mmrm) library(glmmTMB) @@ -19,7 +21,7 @@ library(microbenchmark) # source the R scripts sim_functions_files <- list.files( - c("R/dgp", "R/method", "R/eval", "R/viz"), + c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"), pattern = "*.R$", full.names = TRUE, ignore.case = TRUE ) sapply(sim_functions_files, source) @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix() toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6))) # set the sample size -n_obs <- 600 +n_obs <- 200 # dgps with no treatment effect no_effect_us_dgp <- create_dgp( @@ -157,8 +159,8 @@ type_2_error_rate_eval <- create_evaluator( # create the experiment experiment <- create_experiment( - name = "mmrm-benchmark-low-missingness-n-600-SAS", - save_dir = "results/low-miss/n-600-SAS" + name = glue::glue("mmrm-benchmark-low-missingness-n-{n_obs}-SAS"), + save_dir = glue::glue("results/low-miss/n-{n_obs}-SAS") ) %>% add_dgp(no_effect_us_dgp, name = "no_effect_us") %>% add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>% @@ -188,31 +190,29 @@ experiment <- create_experiment( add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>% add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate") -# # Input here the name of the SAS container. -# hostname <- "sabanesd-byknxg-eu.ocean" -# -# # Do this to register host -# session <- ssh::ssh_connect(hostname) -# ssh_disconnect(session) -# -# # We can also be specific if there are multiple SAS containers we want to connect to. -# cfg_name <- "sascfg_personal_3.py" -# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) -# options(sascfg = cfg_name) -# -# # Test if it works. -# df <- data.frame(a = 1, b = 2) -# sasr::df2sd(df) +# Input here the name of the SAS container. +hostname <- "sabanesd-9nb6cb-eu.ocean" -# run the experiment -# set.seed(56129) -# results <- experiment$run( -# n_reps = 1000, -# save = TRUE, -# verbose = 2, -# checkpoint_n_reps = 10 -# ) +# Do this to register host +session <- ssh::ssh_connect(hostname) +ssh_disconnect(session) + +# We can also be specific if there are multiple SAS containers we want to connect to. +cfg_name <- "sascfg_personal_3.py" +sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) +options(sascfg = cfg_name) -source("R/format-replicate-results/helpers.R") +# Test if it works. +df <- data.frame(a = 1, b = 2) +sasr::df2sd(df) + +# run the experiment +set.seed(56129) +results <- experiment$run( + n_reps = 1000, + save = TRUE, + verbose = 2, + checkpoint_n_reps = 100 +) format_fit_and_save(experiment) diff --git a/simulations/missing-data-benchmarks/R/meals/meal-no-missingness-SAS.R b/simulations/missing-data-benchmarks/R/meals/meal-no-missingness-SAS.R index f625c24dc..e03e03886 100644 --- a/simulations/missing-data-benchmarks/R/meals/meal-no-missingness-SAS.R +++ b/simulations/missing-data-benchmarks/R/meals/meal-no-missingness-SAS.R @@ -3,6 +3,8 @@ ################################################################################ # load required libraries +library(reticulate) +use_virtualenv("daniel") library(simChef) library(mmrm) library(glmmTMB) @@ -19,7 +21,7 @@ library(microbenchmark) # source the R scripts sim_functions_files <- list.files( - c("R/dgp", "R/method", "R/eval", "R/viz"), + c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"), pattern = "*.R$", full.names = TRUE, ignore.case = TRUE ) sapply(sim_functions_files, source) @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix() toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6))) # set the sample size -n_obs <- 600 +n_obs <- 200 # dgps with no treatment effect no_effect_us_dgp <- create_dgp( @@ -148,8 +150,8 @@ type_2_error_rate_eval <- create_evaluator( # create the experiment experiment <- create_experiment( - name = "mmrm-benchmark-no-missingness-n-600-SAS", - save_dir = "results/no-miss/n-600-SAS" + name = glue::glue("mmrm-benchmark-no-missingness-n-{n_obs}-SAS"), + save_dir = glue::glue("results/no-miss/n-{n_obs}-SAS") ) %>% add_dgp(no_effect_us_dgp, name = "no_effect_us") %>% add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>% @@ -178,33 +180,31 @@ experiment <- create_experiment( add_evaluator(coverage_eval, name = "coverage_rate") %>% add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>% add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate") -# -# # Input here the name of the SAS container. -# hostname <- "sabanesd-ddi1zu-eu.ocean" -# -# # Do this to register host -# session <- ssh::ssh_connect(hostname) -# ssh_disconnect(session) -# -# # We can also be specific if there are multiple SAS containers we want to connect to. -# cfg_name <- "sascfg_personal_4.py" -# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) -# options(sascfg = cfg_name) -# -# # Test if it works. -# df <- data.frame(a = 1, b = 2) -# sasr::df2sd(df) -# -# # run the experiment -# set.seed(62342) -# results <- experiment$run( -# n_reps = 1000, -# save = TRUE, -# verbose = 2, -# checkpoint_n_reps = 10 -# ) -source("R/format-replicate-results/helpers.R") +# Input here the name of the SAS container. +hostname <- "sabanesd-m55pe7-eu.ocean" + +# Do this to register host +session <- ssh::ssh_connect(hostname) +ssh_disconnect(session) + +# We can also be specific if there are multiple SAS containers we want to connect to. +cfg_name <- "sascfg_personal_4.py" +sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name) +options(sascfg = cfg_name) + +# Test if it works. +df <- data.frame(a = 1, b = 2) +sasr::df2sd(df) + +# run the experiment +set.seed(62342) +results <- experiment$run( + n_reps = 1000, + save = TRUE, + verbose = 2, + checkpoint_n_reps = 100 +) format_fit_and_save(experiment) diff --git a/simulations/missing-data-benchmarks/sascfg_personal.py b/simulations/missing-data-benchmarks/sascfg_personal.py index b30e9eba8..e75a4c0bb 100644 --- a/simulations/missing-data-benchmarks/sascfg_personal.py +++ b/simulations/missing-data-benchmarks/sascfg_personal.py @@ -1,2 +1,2 @@ SAS_config_names=['default'] -default={'host': 'sabanesd-nwpfwh-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} +default={'host': 'sabanesd-w2yc52-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} diff --git a/simulations/missing-data-benchmarks/sascfg_personal_2.py b/simulations/missing-data-benchmarks/sascfg_personal_2.py index 04307d0ca..baa21e201 100644 --- a/simulations/missing-data-benchmarks/sascfg_personal_2.py +++ b/simulations/missing-data-benchmarks/sascfg_personal_2.py @@ -1,2 +1,2 @@ SAS_config_names=['default'] -default={'host': 'sabanesd-k2n72p-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} +default={'host': 'sabanesd-n5i2d5-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} diff --git a/simulations/missing-data-benchmarks/sascfg_personal_3.py b/simulations/missing-data-benchmarks/sascfg_personal_3.py index 1552b1c65..26c942dce 100644 --- a/simulations/missing-data-benchmarks/sascfg_personal_3.py +++ b/simulations/missing-data-benchmarks/sascfg_personal_3.py @@ -1,2 +1,2 @@ SAS_config_names=['default'] -default={'host': 'sabanesd-byknxg-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} +default={'host': 'sabanesd-k2lza0-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} diff --git a/simulations/missing-data-benchmarks/sascfg_personal_4.py b/simulations/missing-data-benchmarks/sascfg_personal_4.py index 299883fb2..b3580ca1b 100644 --- a/simulations/missing-data-benchmarks/sascfg_personal_4.py +++ b/simulations/missing-data-benchmarks/sascfg_personal_4.py @@ -1,2 +1,2 @@ SAS_config_names=['default'] -default={'host': 'sabanesd-ddi1zu-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992} +default={'host': 'sabanesd-m55pe7-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}