Skip to content
Back to formatted view

Raw Message

Message-ID: <1349438507759-4645150.post@n4.nabble.com>
Date: 2012-10-05T12:01:47Z
From: autarkie
Subject: Setting the desired reference category with contr.sum

Hi,

I have 6 career types, represented as a factor in R, coded from 1 to 6. I
need to use the effect coding (also known as deviation coding) which is
normally done by contr.sum, e.g. 

contrasts(career) <- contr.sum(6)

However, this results in the 6th category being the reference, that is being
coded as -1: 

$contrasts
  [,1] [,2] [,3] [,4] [,5]
1    1    0    0    0    0
2    0    1    0    0    0
3    0    0    1    0    0
4    0    0    0    1    0
5    0    0    0    0    1
6   -1   -1   -1   -1   -1

In fact, I need number 1 to be the reference. How do I achieve that? Thank
you. 

Regards,
Maxim



--
View this message in context: http://r.789695.n4.nabble.com/Setting-the-desired-reference-category-with-contr-sum-tp4645150.html
Sent from the R help mailing list archive at Nabble.com.