Last data update: 2014.03.03

R: Random Treatment Assignments for Isomorphic Latin Square...
latinRandR Documentation

Random Treatment Assignments for Isomorphic Latin Square Designs

Description

Randomly draws an assignment vector or matrix according to the isomorphic Latin square design, for a specified number of permutations.

Usage

latinRand(w, nrand, row, col)

Arguments

w

a vector or matrix of assignments.

nrand

a number specifying the desired number of random assignments.

row

a vector of row designations.

col

a vector of column designations.

Details

Assignments are randomly permuted along rows and columns such that the Latin square design is preserved.

If w is a matrix, the permutations occur by row.

Value

A list of random isomorphic assignment vectors or matrices.

Author(s)

Joseph J. Lee and Tirthankar Dasgupta

See Also

completeRand, blockRand

Examples

w = c("C","D","B","A","A","B","D","C","D","C","A","B","B","A","C","D")
row = rep(1:4,4)
col = c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))
latinRand(w, nrand = 5, row, col)

Results