find_same_col {contrastable}R Documentation

Find column with same non-positive values

Description

The inverse matrix of a contrast matrix has a useful property where, after removing the row corresponding to the intercept, the reference level is the column index where each value in that column is (1) the same and (2) less than or equal to 0.

Usage

find_same_col(invmatrix)

Arguments

invmatrix

Inverse of the hypothesis matrix

Details

For a contrast matrix generated from an expression x, with number of levels n, consider the inverse matrices from solve(.contrasts_to_hypotheses(x)) below for different x:

Note that "reference level" here is defined as a level from which every other level is compared to via pairwise comparisons.

Value

Integer index of the reference level, if there is no reference level, NA is returned


[Package contrastable version 1.0.2 Index]