rand_test | R Documentation |
The rand_test
function computes a randomization test for single or multiple
baseline single-case data. The function is based on an algorithm from the
SCRT
package (Bulte & Onghena, 2009, 2012), but rewritten and extended for
the use in AB designs.
rand_test(
data,
dvar,
pvar,
statistic = c("Mean B-A", "Mean A-B", "Median B-A", "Median A-B", "Mean |A-B|",
"Median |A-B|", "SMD hedges", "SMD glass", "W-test", "T-test", "NAP",
"NAP decreasing", "Slope B-A", "Slope A-B"),
number = 500,
complete = FALSE,
limit = 5,
startpoints = NA,
exclude.equal = FALSE,
phases = c(1, 2),
graph = FALSE,
output = NULL,
seed = NULL
)
data |
A single-case data frame. See |
dvar |
Character string with the name of the dependent variable. Defaults to the attributes in the scdf file. |
pvar |
Character string with the name of the phase variable. Defaults to the attributes in the scdf file. |
statistic |
Defines the statistic on which the comparison of phases A
and B is based on. Default setting is
|
number |
Sample size of the randomization distribution. The exactness of
the p-value can not exceed |
complete |
If TRUE, the distribution is based on a complete permutation of all possible starting combinations. This setting overwrites the number Argument. The default setting is FALSE. |
limit |
Minimal number of data points per phase in the sample. The first
number refers to the A-phase and the second to the B-phase (e.g., |
startpoints |
Alternative to the |
exclude.equal |
If set to |
phases |
A vector of two characters or numbers indicating the two phases
that should be compared. E.g., |
graph |
If |
output |
(deprecated and not implemented) |
seed |
A seed number for the random generator. |
statistic |
Character string from function call (see
|
N |
Number of single-cases. |
n1 |
Number of data points in phase A. |
n2 |
Number of data points in phase B. |
limit |
Numeric from function call (see
|
startpoints |
A vector defining the start points passed from the
function call (see |
p.value |
P-value of the randomization test for the given data. |
number |
Sample size of
randomization distribution from function call (see |
complete |
Logical argument from function call (see |
observed.statistic |
Test statistic observed for the given
single-case data. (see |
Z |
Z-value of observed test statistic. |
p.z.single |
Probability of z-value. |
distribution |
Test statistic distribution from randomized data sets. |
possible.combinations |
Number of possible combinations under the given restrictions. |
auto.corrected.number |
|
ecxlude.equal |
see argument above |
Juergen Wilbert
Bulte, I., & Onghena, P. (2009). Randomization tests for multiple-baseline designs: An extension of the SCRT-R package. Behavior Research Methods, 41, 477-485.
Bulte, I., & Onghena, P. (2012). SCRT: Single-Case Randomization Tests. Available from: https://CRAN.R-project.org/package=SCRT
## Compute a randomization test on the first case of the byHeart2011 data and include a graph
rand_test(byHeart2011[1], statistic = "Median B-A", graph = TRUE, seed = 123)
## Compute a randomization test on the Grosche2011 data using complete permutation
rand_test(Grosche2011, statistic = "Median B-A", complete = TRUE, limit = 4, seed = 123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.