Test a matrix of contrast coefficients for pairwise orthogonality

Description

This function tests all pairwise contrast coefficients for orthogonality. The function tells the user which pair of contrasts are not orthogonal.

Usage

1
ortho(contr, round = 10)

Arguments

contr

A matirx, wiht k-1 rows (one for each contrast) and k columns one for each level of a factor.

round

To test if the sum of the products of the coefficients is zero the sum is rounded using this value as digits argument for round.

Details

For all pairs of contrasts coefficients the sum of the products of the coefficients is calculated and compared if it is zero or not.

Value

a logical

Note

There are more elegant solutions to this problem but this one tells the user which pairs of contrasts are not orthogonal.

Author(s)

thomas.fabbro@unibas.ch

References

none

See Also

mancontr

Examples

1
2
3
4
5
trt.contr <- rbind("control-sugar"=c(1, -1/4, -1/4, -1/4, -1/4),
                   "pure-mixed"=c(0, 1/3, 1/3, -1, 1/3),
                   "monosaccharides-disaccharides"=c(0,1/2,1/2,0,-1),
                   "gluc-fruc"=c(0,1,-1,0,0))
ortho(trt.contr)