| 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 |
b |
Vector of treatment codes |
K |
Total number of treatments. |
i |
Vector of indices |
Value
d_ab2i returns a vector of indices i. d_i2ab
returns a data frame of indices a and b.
Functions
-
d_ab2i: Convertd[i]type indices tod_{ab}type indices. -
d_i2ab: Convertd_{ab}type indices tod[i]type indices.
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]