1. Home
  2. N1SIMULATE procedure

N1SIMULATE procedure

Simulates data for a set of n-of-1 trials (S.J. Senn & R.W. Payne).

Options

PRINT = string tokens Controls printed output from the analysis (parameters, simulateddata); default * i.e. none
TREATMENTS = pointers Treatment factor for each analysis
SUBJECTS = factors Subject factor for each analysis
CYCLES = factors Cycles factor for each analysis

Parameters

Y = variates Simulated data values
MU_LAMBDA = scalars Grand mean for each simulation; default 0
MU_TAU = scalars Mean treatment effect for each simulation; default 1
SIGMA_2= scalars Within-cycle variance for each simulation; default 1
GAMMA_2 = scalars Between-cycle variance for each simulation; default 1
PSI_2 = scalars Treatment-effect variance for each simulation; default 1
PHI_2 = scalars Between-subject variance for each simulation; default 1
SEED = scalars Seed for random numbers; default 0

Description

An n-of-1 trial is a medical trial in a single subject to compare two treatments. The design consists of “cycles” of pairs of periods to which the treatments are allocated in one of the two possible orders. For a set of n-of-1 trials, several subjects (or patients) receive cycles of treatments over a sequence of periods.

This procedure simulates data for a set of trials, to allow its properties to be studied. The TREATMENTS option supplies a factor specifying the treatment allocations in the set. The SUBJECTS option supplies a factor to specify the subjects, and the CYCLES option supplies a factor to specify the cycles within each subject.

The Y parameter saves the simulated data. The other parameter specify the effects and variances used in the simulation. The MU_LAMBDA parameter defines the grand mean; default 0. The MU_TAU parameter defines the mean treatment effect; default 1. The SIGMA_2 parameter defines the within-cycle variance; default 1. The GAMMA_2 parameter defines the between-cycle variance; default 1. The PSI_2 parameter defines the variance of the treatment effects; default 1. Finally, the PHI_2 parameter defines the between-subject variance; default 1.

The PRINT option controls printed output, with settings:

parameters to print the parameters used to generate the simulation, and
simulateddata to print the simulated data.

Acknowledgements: this research was started when working on the European Union’s Seventh Framework Programme for research, technological development and demonstration under Grant Agreement no. 602552 for the IDEAL project and completed when working on the National Institute for Health and Care Research (NIHR) DIAMOND project. Support from both is gratefully acknowledged as is collaboration with Artur Araujo, Robin Chatters, Andrew Cooke, Liv Hawksworth, Steven Julious and Sonia Leite.

Options: PRINT, SUBJECTINTERACTION, FPROBABILITY, PSE, LSDLEVEL

Parameters: Y, TREATMENTS, SUBJECTS, CYCLES 

See also

Procedures: N1ANOVAN1DESIGN, N1PILOT, N1TEST,

Example

CAPTION  'N1SIMULATE example'; STYLE=meta     

N1DESIGN  [PRINT=*; NCYCLES=3; NSUBJECTS=12] SUBJECT=Subject;\
           TREATMENT=Treatment; CYCLE=Cycle; PERIOD=Period; PAIR=Pair;\
           SEED=241015

N1SIMULATE [PRINT=parameters,simulateddata; SUBJECTS=Subject;\
           TREATMENTS=Treatment; CYCLES=Cycle] Y; SIGMA_2=10000;\
           PSI_2=100000; PHI_2=40000; MU_LAMBDA=2700; MU_TAU=200

N1ANOVA   Y=Y; Subjects=Subject; Treatments=Treatment; Cycles=Cycle
Updated on April 3, 2024

Was this article helpful?