I tried to avoid using contrasts and I discovered the relevel
function for choosing a desired level as baseline.
The following code
trainingLR$Class <- relevel(trainingLR$Class, ref = "P")
should set "P" level as your baseline. Therefore, try the same thing with "Q" or "R" levels.
The R Documentation (?relevel
) mentions "This is useful for contr.treatment
contrasts which take the first level as the reference."
Though might be too late to answer now, but since others might be interested, I thought is worthwhile sharing the above option.