# 1. Two orthogonal contrasts on a 4-group design (equal n):
cmat <- cbind(
c_linear = c(-3, -1, 1, 3),
c_quad = c( 1, -1, -1, 1)
)
is_orthogonal_set(cmat)
# 2. Same contrasts under unequal sample sizes:
is_orthogonal_set(cmat, n = c(10, 8, 12, 9))
# 3. Non-orthogonal pair:
cmat_bad <- cbind(
c_diff_1 = c( 1, -1, 0, 0),
c_diff_2 = c( 1, 0, -1, 0)
)
is_orthogonal_set(cmat_bad)
Run the code above in your browser using DataLab