alloc.simple {BATSS}R Documentation

Simple allocation function

Description

alloc.simple independently randomises each unit to a group (i.e., flips a coin for each unit) so that the observed allocation probabilities may be far from the target ones. This strategy is often considered to be a poor choice.

Usage

alloc.simple(m, prob)

Arguments

m

the 'BATSS' ingredient 'm', a scalar corresponding to the number of participants to be allocated.

prob

the 'BATSS' ingredient 'prob', a named vector of allocation ratios or probabilities.

Value

alloc.simple returns an object of class factor of length 'm' with levels matching the names of the vector 'prob'.

See Also

alloc.balanced(), another group allocation function.

Examples

alloc.simple(100, prob = c(A=.4,B=.6))
table(alloc.simple(100, prob = c(A=.4,B=.6)))
table(alloc.simple(100, prob = c(A=.4,B=.6)))

[Package BATSS version 0.7.14 Index]