Reverse helmert coding is the same concept as helmert coding, but the order of the groupings is reversed. See also helmert_code .
reverse_helmert_code(n)
Arguments
n: Integer umber of factor levels to compute contrasts for.
Returns
A contrast matrix with dimensions n rows and (n-1) columns.
Details
Reverse helmert coding compares each level to the total mean of all levels that come after it. Differs from forward difference coding, which only compares pairs of levels (not a level to a cumulative mean of levels).
Example interpretation for a 4 level factor:
Intercept = Grand mean (mean of the means of each level)