Learn R Programming

nmathresh (version 0.1.6)

d_ab2i: Convert contrast indexing

Description

Functions for converting between \(d_{ab}\) indexing of contrasts (useful notationally) and d[i] indexing used by R.

Usage

d_ab2i(a, b, K)

d_i2ab(i, K)

Arguments

a

Vector of treatment codes \(a\).

b

Vector of treatment codes \(b\).

K

Total number of treatments.

i

Vector of indices i.

Value

d_ab2i returns a vector of indices i. d_i2ab returns a data frame of indices a and b.

Functions

  • d_ab2i: Convert d[i] type indices to \(d_{ab}\) type indices.

  • d_i2ab: Convert \(d_{ab}\) type indices to d[i] type indices.

Examples

Run this code
# NOT RUN {
d_ab2i(c(1,1,1, 2,2, 3), c(2,3,4, 3,4, 4), K=4)
d_i2ab(1:6, K=4)

# }

Run the code above in your browser using DataLab