-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
71 lines (47 loc) · 1.82 KB
/
README.Rmd
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# `randolist` <img src='man/figures/logo.png' align="right" width="200">
<!-- badges: start -->
`r badger::badge_custom("dev version", as.character(packageVersion("randolist")), "blue", "https://github.com/CTU-Bern/randolist")`
[](https://github.com/CTU-Bern/randolist/actions)
<!-- badges: end -->
`randolist` contains home-grown functions for creating randomisation lists in R.
## Installation
You can install the development version of `randolist` from github with:
<!-- install.packages("randolist") -->
``` r
remotes::install_github("CTU-Bern/randolist")
```
<!-- Or from CTU Bern's package universe -->
<!-- ``` r -->
<!-- install.packages("randolist", repos = c('https://ctu-bern.r-universe.dev', 'https://cloud.r-project.org')) -->
<!-- ``` -->
## Generating randomization lists
Load the package
```{r}
library(randolist)
```
### Unstratified randomization
Where no strata are defined, the `blockrand` function can be used to create a randomization list.
```{r}
blockrand(n = 10,
blocksizes = 1:2)
```
The treatment label is set via the `arms` argument.
Block sizes are defined via the `blocksizes` argument. The above example creates a randomization list with blocks of 1 or 2 *of each arm* (so in practice, the block sizes are 2 and 4).
Allocation schemes beyond 1:1 randomization are possible by specifying the `arms` argument, specifically by using the same arm label multiple times.
```{r}
blockrand(n = 10,
blocksizes = 1:2,
arms = c("A", "A", "B"))
```