Learn R Programming

BATSS (version 1.1.1)

alloc.simple: 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)

Value

alloc.simple returns an object of class factor of length 'm' with levels matching the names of the vector '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.

See Also

alloc.balanced(), another group allocation function.

Examples

Run this code
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)))

Run the code above in your browser using DataLab