Enum Class ContrastCoding
- All Implemented Interfaces:
Serializable, Comparable<ContrastCoding>, Constable
Both codings give a factor with k levels k-1 columns, so the model has the same rank either way and nothing downstream of the fit changes shape. What changes is the question each coefficient answers.
- Author:
- paul
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEach level gets a column, the one left over takes-1in all of them, and a coefficient is that level's deviation from the mean of the level means.Each level gets an indicator column; one level has none and is the baseline. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContrastCodingReturns the enum constant of this class with the specified name.static ContrastCoding[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TREATMENT
Each level gets an indicator column; one level has none and is the baseline. A coefficient is that level's difference from the baseline. R'scontr.treatment, and Gemma's behaviour everywhere until this enum existed.This is the right coding when one level is a control that the others are meant to be read against — a wild-type, an untreated arm, a vehicle.
-
SUM_TO_ZERO
Each level gets a column, the one left over takes-1in all of them, and a coefficient is that level's deviation from the mean of the level means. R'scontr.sum; also called deviation or sum-to-zero coding.This is the coding for a factor with no control level — a panel of tissues, a set of cell lines, a collection of time points treated symmetrically. Under treatment coding one of those has to be nominated as the baseline, every other level is then reported relative to that arbitrary choice, and the nominated one gets no contrast of its own. Here every level is reported against the same reference and none of them is privileged.
🛑 The reference is the mean of the LEVEL means, not the mean of the samples. They differ whenever the levels have different numbers of samples, and the level means are what the model estimates.
The deviations sum to zero by construction, so the level without a column of its own is still fully determined: its deviation is minus the sum of the others.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-