Learn R Programming

randomizationInference (version 1.0.1)

blockRand: Permutations of Treatment Assignments for Randomized Block Designs

Description

Randomly permutes an assignment vector or matrix according to a randomized block design, for a specified number of permutations.

Usage

blockRand(w, nperm, block)

Arguments

w
a vector or matrix of assignments.
nperm
a number specifying the desired number of random permutations.
block
a vector of block designations.

Value

  • A list of permuted assignment vectors or matrices.

Details

Assignments are permuted within each block. If w is a matrix, the permutations occur by row.

See Also

completeRand, latinRand

Examples

Run this code
w1 = c(0,1,0,1,0,1,0,1)
block = c(0,0,0,0,1,1,1,1)
blockRand(w1, nperm = 5, block)

w2 = c(0,0,1,1,0,0,1,1)
blockRand(w = cbind(w1,w2), nperm = 5, block)

Run the code above in your browser using DataLab