d_ab2i {nmathresh}R Documentation

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

Note

By convention, 1 \le a < b \le K. If this is not the case, an error will be thrown. For a given number of treatments K, the total number of possible contrasts d_{ab} is K(K-1)/2, and hence i \le K. Again, if this is not the case, an error will be thrown.

Examples

d_ab2i(c(1,1,1, 2,2, 3), c(2,3,4, 3,4, 4), K=4)
d_i2ab(1:6, K=4)


[Package nmathresh version 0.1.6 Index]