Single-case data generator
The rSC
function generates random single-case data frames
for monte-carlo studies and demonstration purposes.
design_rSC
is used to set up a design matrix with all parameters needed for the rSC
function.
rSC(design = NULL, round = NA, random.names = FALSE, seed = NULL, ...) design_rSC( n = 1, phase.design = list(A = 5, B = 15), trend = list(0), level = list(0), slope = list(0), rtt = list(0.8), m = list(50), s = list(10), extreme.p = list(0), extreme.d = c(-4, -3), missing.p = list(0), distribution = "normal", prob = 0.5, MT = NULL, B.start = NULL )
design |
A design matrix which is created by design_rSC and specifies all paramters. |
round |
Rounds the scores to the defined decimal. To round to the second
decimal, set |
random.names |
Is |
seed |
A seed number for the random generator. |
... |
Paramteres that are directly passed from the rSC function to the design_rSC function for a more concise coding. |
n |
Number of cases to be created (Default is |
phase.design |
A vector defining the length and label of each phase.
E.g., |
trend |
Defines the effect size d of a trend per MT added
across the whole data-set. To assign different trends to several
single-cases, use a vector of values (e.g. |
level |
Defines the level increase (effect size d) at the
beginning of phase B. To assign different level effects to several
single-cases, use a vector of values (e.g. |
slope |
Defines the increase in scores - starting with phase B -
expressed as effect size d per MT. |
rtt |
Reliability of the underlying simulated measurements. Set
|
m |
Mean of the sample distribution the scores are drawn from. Default
is |
s |
Standard deviation of the sample distribution the scores are drawn
from. Set to |
extreme.p |
Probability of extreme values. |
extreme.d |
Range for extreme values, expressed as effect size d.
|
missing.p |
Portion of missing values. |
distribution |
Distribution of the scores. Default is |
prob |
If |
MT |
Number of measurements (in each study). Default is |
B.start |
Phase B starting point. The default setting |
A single-case data frame. See scdf
to learn about this format.
Juergen Wibert
## Create random single-case data and inspect it design <- design_rSC( n = 3, rtt = 0.75, slope = 0.1, extreme.p = 0.1, missing.p = 0.1 ) dat <- rSC(design, round = 1, random.names = TRUE, seed = 123) describeSC(dat) plotSC(dat) ## And now have a look at poisson-distributed data design <- design_rSC( n = 3, B.start = c(6, 10, 14), MT = c(12, 20, 22), m = 10, distribution = "poisson", level = -5, missing.p = 0.1 ) dat <- rSC(design, seed = 1234) pand(dat, decreasing = TRUE, correction = FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.