Learn R Programming

randomizationInference (version 1.0.4)

latinRand: 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.

Value

A list of random isomorphic assignment vectors or matrices.

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.

See Also

completeRand, blockRand

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab