Description Usage Arguments Details References See Also Examples

View source: R/distribution.random.R

The nonexhaustive randomization distribution is generated by a random sample of all assignment possibilities.

1 2 3 | ```
distribution.random(design, statistic, save = "no",
number, limit, data = read.table(file.choose(new = FALSE)),
starts = file.choose(new = FALSE), assignments = file.choose(new = FALSE))
``` |

`design` |
Type of single-case design: |

`statistic` |
Test statistic. For alternation designs, multiple-baseline designs and AB phase designs, there are 3 built-in possibilities: |

`save` |
Save the randomization distribution to a file ( |

`number` |
Number of randomizations required. Please note that the observed test statistic is always included in the randomization distribution. |

`limit` |
For phase designs: minimum number of observations per phase. For alternating treatments designs: maximum number of consecutive administrations of the same condition. |

`data` |
File in which the data can be found. Default: a window pops up in which the file can be selected. |

`starts` |
Only for multiple baseline designs: location of the file where the possible start points can be found. Default: a window pops up in which the file can be selected. |

`assignments` |
Only for user specified designs: location of the file where all the possible assignments can be found. Default: a window pops up in which the file can be selected. |

When using the default `data`

argument, a window will pop up to ask in what file the data can be found. This text file containing the data should consist of two columns for single-case phase and alternation designs: the first with the condition labels and the second with the obtained scores.
For multiple-baseline designs it should consist of these two columns for EACH unit. This way, each row represents one measurement occasion. It is important not to label the rows or columns.

For multiple baseline designs, when using the default `starts`

argument, second a window pops up in which is asked in what file the possible start points can be found. In this startpoint file, each row should contain all possibilities for one unit, separated by a tab. The rows and columns should not be labeled.

For user specified designs, when using the default `assignments`

argument, second a window pops up in which is asked in what file all the possible assignments can be found. In this file, each row should contain the sequence of conditions in one possible assignment, separated by a tab. There should be one row for every possible assignment. The rows and columns should not be labeled.

Missing data should be indicated as `NA`

. When there is missing data, randomization distribution is generated as usual, but instead of randomly reshuffling numerical scores only, the missing data markers (`NA`

) are also included in the reshuffling. For test statistic calculations, missing data are omitted.

When choosing to save the randomization distribution to a file, next a window will pop up (for multiple baseline designs or user specified designs this is the third pop-up window, for all other designs it is the second window) to ask where to save it. This location can be an existing file, as well as a new file that can be created by giving a file name and the extension .txt. In this latter case a confirmation is required ("The file does not exist yet. Create the file?").

Bulte, I., & Onghena, P. (2008). An R package for single-case randomization tests. Behavior Research Methods, 40, 467-478.

Bulte, I., & Onghena, P. (2009). Randomization tests for multiple baseline designs: An extension of the SCRT-R package. Behavior Research Methods, 41, 477-485.

Edgington, E.S., & Onghena, P. (2007). Randomization Tests (4th ed.). Boca Raton, FL: Chapman & Hall/CRC.

Hope, A.C.A. (1968). A simplified Monte Carlo significance test procedure. Journal of the Royal Statistical Society, Series B 30, 582-598.

Onghena, P. & May, R.B. (1995). Pitfalls in computing and interpreting randomization test p values: A commentary on Chen and Dunlap. Behavior Research Methods, Instruments, & Computers, 27, 408-411.

http://ppw.kuleuven.be/home/english/research/mesrg

`pvalue.random`

to obtain the corresponding p-value for the nonexhaustive randomization distribution.

`observed`

to calculate the observed test statistic.

`distribution.systematic`

to generate the exhaustive randomization distribution and
`pvalue.systematic`

to obtain the corresponding p-value.

1 2 3 |

```
[1] 0.6204545 0.6204545 0.6954545 0.6954545 0.7500000 0.8416667 0.9416667
[8] 1.0166667 1.0166667 1.0607143 1.0773810 1.1482143 1.1666667 1.1666667
[15] 1.1845238 1.2000000 1.2000000 1.2017857 1.2017857 1.2023810 1.2023810
[22] 1.2068182 1.2083333 1.2208333 1.2559524 1.2559524 1.2666667 1.2708333
[29] 1.2916667 1.2916667 1.2916667 1.2916667 1.2916667 1.3107143 1.3107143
[36] 1.3166667 1.3428571 1.3642857 1.3670635 1.3750000 1.4196429 1.4196429
[43] 1.4196429 1.4196429 1.4196429 1.4277778 1.4333333 1.4333333 1.4357143
[50] 1.4357143 1.4666667 1.4791667 1.4791667 1.4833333 1.4833333 1.5111111
[57] 1.5428571 1.5625000 1.5696429 1.5696429 1.5777778 1.5833333 1.5892857
[64] 1.6071429 1.6458333 1.6488095 1.6500000 1.6857143 1.6857143 1.6857143
[71] 1.6857143 1.6875000 1.6875000 1.6916667 1.6916667 1.6916667 1.6916667
[78] 1.6916667 1.7000000 1.7142857 1.7333333 1.7500000 1.7500000 1.7619048
[85] 1.8023810 1.8027778 1.8375000 1.8571429 1.8571429 1.8571429 1.8777778
[92] 1.9583333 1.9821429 2.0000000 2.0000000 2.0625000 2.0625000 2.0625000
[99] 2.1000000 2.1000000
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.