Learn R Programming

randotools (version 0.2.4)

check_plan: Check randomisation plan

Description

Before committing to a randomisation plan (in terms of the number of strata, block sizes etc) it can be useful to estimate the imbalance that might be expected. This function simulates trials of a given sample size and returns the imbalance that might be expected.

Usage

check_plan(
  n_rando,
  n_strata,
  arms = c("A", "B"),
  blocksizes = c(1, 2),
  n_sim = 1000
)

# S3 method for checkplan print(x, ...)

Value

list of class checkplan with slots the same slots as input to the function plus mean (mean imbalance), counts (counts of the imbalances) and worst_case (randomisation results with the worst observed imbalance)

Arguments

n_rando

number of participants to randomise

n_strata

number of strata

arms

arms that will be randomised

blocksizes

number of each randomisation group per block (e.g. 1 = one of each arm per block, 2 = per of each arm per block)

n_sim

number of simulations

x

check_plan object

...

options passed to print.data.frame

Functions

  • print(checkplan): Print method for check_plan output

See Also

https://www.sealedenvelope.com/randomisation/simulation/

Examples

Run this code

check_plan(50, 3, n_sim = 50)

Run the code above in your browser using DataLab