Skip to content
No description, website, or topics provided.
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
fit.R
fitplugin.R
fmt-funcs.R
fmt-sim1.R
fmt-sim2.R
fmt-sim3.R
gen.R
res-tex.R
sim1.R
sim2.R
sim3.R
simfuncs.R

README.md

Simulation code for "Linear Mixed Models for Comparing Dynamic Treatment Regimens on a Longitudinal Outcome in Sequentially Randomized Trials"

Command line arguments for each simulation script (sim1.R, sim2.R, sim3.R):

  1. sample size
  2. number of Monte Carlo replicates
  3. seed for the random number generator
  4. desired number of cores for parallelization
  5. effect size (optional, either "small", "med", or "large")

Simulation 1

To obtain raw simulation results in .RData format:

Rscript --vanilla sim1.R 50 1000 304 3
Rscript --vanilla sim1.R 200 1000 304 3
Rscript --vanilla sim1.R 1000 1000 304 3
Rscript --vanilla sim1.R 5000 1000 304 3 small
Rscript --vanilla sim1.R 5000 1000 304 3 med
Rscript --vanilla sim1.R 5000 1000 304 3 large

To produce LaTeX table:

Rscript --vanilla fmt-sim1.R

Simulation 2

To obtain raw simulation results in .RData format:

Rscript --vanilla sim2.R 50 1000 304 3 med
Rscript --vanilla sim2.R 200 1000 304 3 med
Rscript --vanilla sim2.R 1000 1000 304 3 med
Rscript --vanilla sim2.R 5000 1000 304 3 med

To produce LaTeX table:

Rscript --vanilla fmt-sim2.R

Simulation 3 (in supplementary materials)

To obtain raw simulation results in .RData format:

Rscript --vanilla sim3.R 200 1000 304 3 med 
Rscript --vanilla sim3.R 1000 1000 304 3 med
Rscript --vanilla sim3.R 5000 1000 304 3 med

To produce LaTeX table:

Rscript --vanilla fmt-sim3.R
You can’t perform that action at this time.