Learn R Programming

blockTools (version 0.1)

blockTools-package: Block, randomly assign, and diagnose potential problems between units in randomized experiments

Description

Block units into experimental blocks, with one unit per treatment condition, by creating a measure of multivariate distance between all possible pairs of units. Maximum, minimum, or an allowable range of differences between units on one variable can be set. Randomly assign units to treatment conditions. Diagnose potential interference problems between units assigned to different treatment conditions. Write outputs to .tex and .csv files.

Arguments

Details

ll{ Package: blockTools Type: Package Version: 0.1 Date: 2007-08-24 License: GNU GPL Version 2 (or later) } Given raw data, block creates experimental blocks, assignment assigns units to treatment conditions, diagnose detects possible interference problems, and outTeX and outCSV write block or assignment output objects to a set of .tex and .csv files, respectively.

References

http://www.people.fas.harvard.edu/~rtmoore/software.blockTools.htm

Examples

Run this code
data(x100)

## block
out <- block(x100, groups = "g", n.tr = 2, id.vars = c("id"), block.vars
             = c("b1", "b2"), algorithm="optGreedy", distance =
             "mahalanobis", level.two = FALSE, valid.var = "b1",
             valid.range = c(0,500), verbose = TRUE)
## assign
assg <- assignment(out, seed = 123)
## diagnose
diag <- diagnose(object = assg, data = x100, id.vars = "id",
                suspect.var = "b2", suspect.range = c(0,50))
## create .tex files of assigned blocks
outTeX(assg)
## create .csv files of unassigned blocks
outCSV(out)

Run the code above in your browser using DataLab