## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
Sys.setenv(OMP_THREAD_LIMIT = 1) # Reducing core use, to avoid accidental use of too many cores
library(Colossus)
library(data.table)

## -----------------------------------------------------------------------------
model <- Cox(t0, t1, event) ~ loglinear(a, r0, s0)

a_n <- c(0.1, 0.1, 0.1)

## ----eval=FALSE---------------------------------------------------------------
# # The two columns in the model to replace are the radiation/sleeping covariates
# # The items in dose_index correspond to items in the model
# dose_index <- c("r0", "s0")
# 
# # columns to be used for realizations 0-4, rows for each column being replaced
# dose_realizations <- matrix(
#   c("r0", "r1", "r2", "r3", "r4", "s0", "s1", "s2", "s3", "s4"),
#   nrow = 2, byrow = TRUE
# )

## ----eval=FALSE---------------------------------------------------------------
# e_fma <- CoxRunMulti(model, df,
#   a_n = a_n,
#   realization_columns = realization_columns,
#   realization_index = realization_index,
#   fma = TRUE
# )
# 
# # The result will return matrices/vectors for the results
# # in each realization.
# # The output can be printed for information.

## ----eval=FALSE---------------------------------------------------------------
# e_mcml <- CoxRunMulti(model, df,
#   a_n = a_n,
#   realization_columns = realization_columns,
#   realization_index = realization_index,
#   mcml = TRUE
# )
# 
# # The result will return a standard regression output.
# # The number of realizations will also be output.

## ----eval=FALSE---------------------------------------------------------------
# model <- Logit(trial, e0) ~ loglinear(a, r, s)
# 
# a_n <- c(0.1, 0.1, 0.1)
# 
# # The only column in the model to replace is the number of events
# event_realizations <- matrix(
#   c("e0", "e1", "e2", "e3", "e4"),
#   nrow = 1
# )
# 
# e_fma <- LogisticRunMultiOut(model, df,
#   a_n = a_n,
#   realization_columns = realization_columns
# )
# 
# # The result will return matrices/vectors for the results
# # in each realization.
# # The output can be printed for information.

