withinBlockEffects {randomizationInference}R Documentation

Pairwise Differences of Mean Outcomes Within Blocks

Description

Calculates the differences of mean outcomes for multiple specified treatment factors and specified pairs of comparison levels, within the specified blocks.

Usage

withinBlockEffects(y, w, calcOptions)

Arguments

y

a vector or matrix of outcomes.

w

a vector or matrix of assignments.

calcOptions

a list of options for calculating the difference of mean outcomes within blocks. calcOptions$block is a vector denoting the block designations. The numeric vector calcOptions$factors denotes the treatment factors of interest. calcOptions$pairs is a matrix of pairs (specified by row) of levels for comparison. calcOptions$blockindex is a vector of indices denoting the blocks within which the pairs should be compared.

Details

calcOptions$block should have the same length as y and w.

If unspecified, calcOptions$pairs defaults to c(0,1).

If calcOptions$factors is specified, its length must equal the number of rows specified in calcOptions$pairs. If unspecified, calcOptions$factors defaults to an appropriately-sized vector of 1's.

calcOptions$blockindex should have the same length as calcOptions$factors.

Value

A vector of differences of mean outcomes within blocks.

Author(s)

Joseph J. Lee and Tirthankar Dasgupta

References

Moore, David S., and George P. McCabe (1989). Introduction to the Practice of Statistics. Original source: study conducted by Jim Baumann and Leah Jones of the Purdue University Education Department.

See Also

diffMeansVector

Examples

# Reading comprehension pre- and post-test example
data(reading)
withinBlockEffects(
  y = reading$Diff1,
  w = reading$Group,
  calcOptions = list(
    block = reading$Block,
    pairs = rbind(
      c("Basal", "DRTA"),
      c("Basal", "Strat"),
      c("DRTA", "Strat"),
      c("Basal", "DRTA"),
      c("Basal", "Strat"),
      c("DRTA", "Strat")
    ),
    blockindex = c(rep(1, 3), rep(2, 3))
  )
)

[Package randomizationInference version 1.0.4 Index]