Skip to contents

block_design creates a length-2 list containing:

  • a matrix that identifies which items correspond to which blocks and

  • a table of block descriptive statistics.

Usage

block_design(n_blocks = NULL, item_parameters, item_block_matrix = NULL)

Arguments

n_blocks

an integer indicating how many blocks to create.

item_parameters

a data frame of item parameters.

item_block_matrix

a matrix of indicators to assign items to blocks.

Warning

The default item_block_matrix spirals the items across the n_blocks and requires n_blocks >= 3. If n_blocks < 3, item_block_matrix must be specified.

The columns of item_block_matrix represent each block while the rows represent the total number of items. item_block_matrix[1, 1] = 1 indicates that block 1 contains item 1 while item_block_matrix[1, 2] = 0 indicates that block 2 does not contain item 1.

Examples

item_param <- data.frame(item = seq(1:25), b = runif(25, -2, 2))
ib_matrix_values <- c(
  1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1
)
ib_matrix <- matrix(
  ib_matrix_values, nrow = 25, ncol = 5, byrow = FALSE
)
block_design(
  n_blocks = 5, item_parameters = item_param, item_block_matrix = ib_matrix
)
#> $block_assignment
#>    b1 b2 b3 b4 b5
#> i1  1  5 11 16 22
#> i2  2  6 12 17 23
#> i3  3  7 13 18 24
#> i4  4  8 14 19 25
#> i5  0  9 15 20  0
#> i6  0 10  0 21  0
#> 
#> $block_descriptives
#>    block length average difficulty
#> b1            4             -0.684
#> b2            6             -0.126
#> b3            5              0.435
#> b4            6              0.137
#> b5            4             -0.063
#> 
block_design(n_blocks = 5, item_parameters = item_param)
#> $block_assignment
#>    b1 b2 b3 b4 b5
#> i1  1  2  3  4  5
#> i2  6  7  8  9 10
#> i3 11 12 13 14 15
#> i4 16 17 18 19 20
#> i5 21 22 23 24 25
#> 
#> $block_descriptives
#>    block length average difficulty
#> b1            5             -0.535
#> b2            5             -0.167
#> b3            5              0.205
#> b4            5             -0.516
#> b5            5              0.862
#>