design | R Documentation |
Generates a parameter list used for generating multiple random single-cases.
This is used within the random_scdf
function and the power_test
function
and for other Monte-Carlo tasks.
design(
n = 1,
phase_design = list(A = 5, B = 15),
trend = 0,
level = list(0),
slope = list(0),
start_value = 50,
s = 10,
rtt = 0.8,
extreme_prop = list(0),
extreme_range = c(-4, -3),
missing_prop = 0,
distribution = c("normal", "gaussian", "poisson", "binomial"),
random_start_value = FALSE,
n_trials = NULL,
mt = NULL,
B_start = NULL,
m,
phase.design,
MT,
B.start,
extreme.p,
extreme.d,
missing.p
)
n |
Number of cases to be designed (Default is |
phase_design , phase.design |
A list defining the length and label of each
phase. E.g., |
trend |
Defines the effect size of a trend added incrementally to each
measurement across the whole data-set. To assign different trends to
several single-cases, use a vector of values (e.g. |
level |
A list that defines the level increase (effect size d) at the
beginning of each phase relative to the previous phase (e.g. |
slope |
A list that defines the increase per measurement for each phase
compared to the previous phase. |
start_value , m |
Starting value at the first measurement. Default is
|
s |
Standard deviation used to calculate absolute values from level,
slope, trend effects and to calculate and error distribution from the |
rtt |
Reliability of the underlying simulated measurements. Set |
extreme_prop , extreme.p |
Probability of extreme values. |
extreme_range , extreme.d |
Range for extreme values. |
missing_prop , missing.p |
Portion of missing values. |
distribution |
Distribution of the criteria varible. Default is
|
random_start_value |
If TRUE, the start_values are randomized based on the distribution. |
n_trials |
If |
mt , MT |
Number of measurements (in each study). Default is |
B_start , B.start |
Phase B starting point. The default setting |
An object of class sc_design.
Juergen Wibert
## Create random single-case data and inspect it
design <- design(
n = 3, rtt = 0.75, slope = 0.1, extreme_prop = 0.1,
missing_prop = 0.1
)
dat <- random_scdf(design, round = 1, random.names = TRUE, seed = 123)
describe(dat)
## And now have a look at poisson-distributed data
design <- design(
n = 3, B_start = c(6, 10, 14), mt = c(12, 20, 22), start_value = 10,
distribution = "poisson", level = -5, missing_prop = 0.1
)
dat <- random_scdf(design, seed = 1234)
pand(dat, decreasing = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.