inst/nami_simulations/simulation_code/RCT_permtest/binary/experiments.R

############# Experiments BINARY

#----
# 0) Setup
#----
source("../def.R")
NLIST <- 161
PROBNAM <- "binary"
source("../../helpers.R")

set.seed(SEED)
setups <- expand.grid(repl = seq(1, REPL), N = NLIST, P = PLIST, truetau = TAULIST, lambda = LAMBDALIST)
setups$seed <- round(runif(nrow(setups)) * 1e8)

#----
# 1) Load helper functions & libraries
#----
pkgs <- c("tram", "batchtools", "multcomp", "coin")
get_packages(pkgs)

generate_data <- function(...) generate_bin(..., RCT = TRUE)

#----
# 2) Define methods 
#----
methods <- list("polr_w" = fun_polr_w,
                "polr_wx" = fun_polr_wx,
                "mmlt_polr" = fun_mmlt_polr)

if (TESTONLY) {
   d <- fun(1, 100, 5, truetau = 0, lambda = 1, seed = 19724948)
   print(lapply(methods, function(f) f(d)))
} else {
   source("../../run_experiments.R")
}
  

Try the tram package in your browser

Any scripts or data that you put into this service are public.

tram documentation built on Nov. 23, 2026, 5:07 p.m.