Description Usage Arguments Value
View source: R/simulate.helpers.R
Generates parameters for simulating data for the study e.g. what is the recruitment rate, mean, intervention effect etc in each cluster.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | generate.sim.parameters.dt(
cluster.dt,
sequence.dt,
ppt.per.unit.time.mean = 1,
target.n.participants = NA,
ppt.per.unit.time.sd = 0.1,
ppt.per.unit.time.sd.proportion.of.mean = NA,
base.outcome = 10,
intervention.effect.mean = 1,
intervention.effect.sd = 0.1,
intervention.effect.sd.proportion.of.mean = NA,
cluster.effect.mean = 0,
cluster.effect.sd = 0.1,
cluster.effect.sd.proportion.of.mean = NA,
time.effect.per.unit.mean = 0.01,
time.effect.per.unit.sd = 0.001,
time.effect.per.unit.sd.proportion.of.mean = NA,
individual.noise.mean = 0.2,
individual.noise.sd = 0.04,
individual.noise.sd.proportion.of.mean = NA,
cycle.amplitude.mean = 0.8,
cycle.amplitude.sd = 0.1,
cycle.amplitude.sd.proportion.of.mean = NA,
cycle.start.mean = 10,
cycle.start.sd = 0,
cycle.start.sd.proportion.of.mean = NA,
cycle.period.mean = 20,
cycle.period.sd = 0,
cycle.period.sd.proportion.of.mean = NA,
min.time = 0,
max.time = NA,
n.to.generate = 1
)
|
cluster.dt |
A study info data.table, containing data about clusters. |
sequence.dt |
A study info data.table, containing data about sequences. |
ppt.per.unit.time.mean |
What is the mean recruitment rate across clusters per one time. |
target.n.participants |
Integer how many participants, will adjust ppt.per.unit.time.mean in sim.parameters.dt by weighting them to get the desired number (Default: NA) |
ppt.per.unit.time.sd |
What is the variance in the recruitment rate between clusters. |
ppt.per.unit.time.sd.proportion.of.mean |
What is the variance in the recruitment rate between clusters as a multiple of mean. Will override ppt.per.unit.time.sd, disabled by default. |
base.outcome |
The outcome at every cluster before adding any effects |
intervention.effect.mean |
The mean effect of the intervention across cluster. |
intervention.effect.sd |
The variance in the effect of the intervention between clusters. |
intervention.effect.sd.proportion.of.mean |
The variance in the effect of the intervention between clusters as a multiple of mean. Will override intervention.effect.sd, disabled by default. |
cluster.effect.mean |
The mean effect associated with each cluster. |
cluster.effect.sd |
The variance in the effect associated with cluster. |
cluster.effect.sd.proportion.of.mean |
The variance in the effect associated with cluster as a multiple of mean. Will override cluster.effect.sd, disabled by default. |
time.effect.per.unit.mean |
The mean effect of time per one unit across clusters. |
time.effect.per.unit.sd |
The variance in the effect of time per one unit between clusters. |
time.effect.per.unit.sd.proportion.of.mean |
The variance in the effect of time per one unit between clusters as a multiple of mean. Will override time.effect.per.unit.sd, disabled by default. |
individual.noise.mean |
The mean of the standard deviation used to generate individual noise across clusters (i.e. generated by rnorm). |
individual.noise.sd |
The variance in the standard deviation used to generate individual noise across clusters. |
individual.noise.sd.proportion.of.mean |
The variance in the standard deviation used to generate individual noise across clusters as a multiple of mean. Will override individual.noise.sd, disabled by default. |
cycle.amplitude.mean |
The mean amplitude of the cyclical effect across clusters. |
cycle.amplitude.sd |
The variance in the amplitude of the cyclical effect between clusters. |
cycle.amplitude.sd.proportion.of.mean |
The variance in the cycle start time between clusters as a multiple of mean. Will override cycle.start.sd, disabled by default. |
cycle.start.mean |
The mean cycle start time across clusters. |
cycle.start.sd |
The variance in the cycle start time between clusters. |
cycle.period.mean |
The mean cycle period across clusters. |
cycle.period.sd |
The variance in the cycle period between clusters. |
cycle.period.sd.proportion.of.mean |
The variance in the cycle period between clusters as a multiple of mean. Will override cycle.period.sd, disabled by default. |
min.time |
Minimum time value (Default: 0) |
max.time |
Maximum time value, if NA will be calculated from sequence.dt, by assuming equal period lengths, which may not be correct (Default: NA) |
n.to.generate |
Integer how many different effects to generate. If more than one, an integer column will be added (sim.number) to delineate. (Default: 1) |
The provided cluster.dt parameter, with simulation parameters added as columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.