Change a factor's reference level
Arguments
- x
A factor to be rebased
- lev
The level of the factor that is to be regarded as the 'control' to which all others will be compared
Value
A factor with a new contrast attribute
Details
Rather than change the order of the levels, this changes the way
the factor is parametrised, so that the levels are in the natural order
but the coefficients can reflect experimental design considerations