blockRandomLists: Block randomize a set of trials.

Description Usage Arguments Details Value Author(s) Examples

Description

Generate a specified number of uniquely block randomized copies of a stimulus list.

Usage

1
blockRandomLists(nLists = 4, repBlock = 2, nCond, data)

Arguments

nLists

Number of randomized lists to create (default=4).

repBlock

Number of repetitions/condition within each randomization block (default=2). How many items in each condition in each block?

nCond

Number of conditions in data. It may actually be better to require a column for condition label in the input DF and then (2) count the number of conditions. So if we have a 2x2 design (Freq, Cons) with levels (HF,LF) and (HC,LC), then a Cond variable would just contain labels derived via interaction (Freq, Cons).

data

A data.frame containing specification of all experimental trials (items), blocked so that each block contains the appropriate number of trials in each condition.

Details

The purpose of this function is to create a set of randomized copies of a given stimulus list. At present, the function does not check to ensure that all lists are unique. Counterbalancing of lists must be done separately.

Value

A list of data.frames. Each data.frame will contain a (probably unique) block randomized list of items the same length as the input DF.

Author(s)

David Braze davebraze@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
    ## Not run: 
    ## use case 1
    ## first build a master data.frame to work from
    library(reshape)
    D <- expand.grid(freq=c("HF", "LF"), cons=c("HC", "LC"))
    cond <- interaction(D$freq, D$cons)
    D <- data.frame(D, cond)
    D <- expand.grid.df(D,data.frame(blockID=1:6))
    nCond <- length(unique(D$cond))
    nRep <- 6
    itemID <- 1:(nCond*nRep)
    D <- data.frame(D, itemID)
    blockRandomLists(nLists=3, nCond=4, data=D)
    
## End(Not run)

davebraze/FDB1 documentation built on May 14, 2019, 8:59 p.m.