Construct contrasts for pairwise differences between parameters,
or apply these contrasts to an estimate object.
Usage
pairwise_diff(n, idx = NULL, reverse = FALSE)
Value
A numeric contrast matrix if n is an integer, or an estimate
object if n is an estimate object.
Arguments
n
An integer giving the total number of parameters, or an
estimate object from which the number of parameters is derived.
idx
An integer vector of parameter indices to compare.
If NULL, all parameters are compared.
reverse
Logical; if TRUE, reverse the direction of each
difference by multiplying the contrast matrix by -1.
Details
When n is an integer, the function returns a contrast matrix with
n columns and one row for each pairwise comparison. If idx is
supplied, only pairs of parameters selected by idx are compared.
When n is an estimate object, the number of parameters is obtained
from length(coef(n)). The contrast matrix is applied to the object,
returning an estimate object containing the pairwise differences
and their propagated uncertainty.