
Introduction to SEQuential
SEQuential.Rmd
Setting up your Analysis
The flow of the SEQuential R package never changes, nor are there planned changes to this flow in the future.
Step 1 - Defining your options
In your R script, you will always start by defining your options
object, through the SEQopts
helper. There are many defaults
which allow you to target exactly how you would like to change your
analysis. Through this wiki there are specific pages dedicated to each
causal contrast and the parameters which affect them, but for simplicity
let’s start with an intention-to-treat analysis with 20 bootstrap
samples.
library(SEQTaRget)
options <- SEQopts(km.curves = TRUE, #asks the function to return survival and risk estimates
bootstrap = TRUE, #asks the model to preform bootstrapping
bootstrap.nboot = 10) #asks the model for 10 bootstrap samples
In general, options will be in the form
{option}.{parameter}
- here you may notice that we use
bootstrap.nboot
indicating that this parameter affects the
bootstrap
Step 2 - Running the Primary Function
The next step is running the primary R function,
SEQuential
. Here you will give your options, data, and
data-level information. We provide some small simulated datasets to test
on.
data <- SEQdata
model <- SEQuential(data, id.col = "ID",
time.col = "time",
eligible.col = "eligible",
treatment.col = "tx_init",
outcome.col = "outcome",
time_varying.cols = c("N", "L", "P"),
fixed.cols = "sex",
method = "ITT", options = options)
SEQuential
is a rather chunky algorithm and will take
some time to run, especially when bootstrapping. We provide some print
statements to help track where the function is processing at any given
point in time.