Re: [R] Behavior of ordered factors in glm

2008-01-06 Thread David Winsemius
Thank you, Dr Ripley. After some false starts and consulting MASS2, Chambers&Hastie and the help files, this worked acceptably. > xxx$issuecat2<-C(xxx$issuecat2,poly,1) > attr(xxx$issuecat2,"contrasts") .L 0-39 -6.324555e-01 40-49 -3.162278e-01 50-59 -3.287978e-17 60-69 3.1622

Re: [R] Behavior of ordered factors in glm

2008-01-06 Thread Marc Schwartz
David Winsemius wrote: > I have a variable which is roughly age categories in decades. In the > original data, it came in coded: >> str(xxx) > 'data.frame': 58271 obs. of 29 variables: > $ issuecat : Factor w/ 5 levels "0 - 39","40 - 49",..: 1 1 1 1... > snip > > I then defined issuecat as

Re: [R] Behavior of ordered factors in glm

2008-01-05 Thread Prof Brian Ripley
Further to Duncan's comments, you can control factor codings via options(contrasts=), by setting contrasts() on the factor and via C(). This does enable you to code an ordered factor as a linear term, for example. The only place I know that this is discussed in any detail is in Bill Venables' a

Re: [R] Behavior of ordered factors in glm

2008-01-05 Thread Duncan Murdoch
On 05/01/2008 7:16 PM, David Winsemius wrote: > David Winsemius <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > >> I have a variable which is roughly age categories in decades. In the >> original data, it came in coded: >>> str(xxx) >> 'data.frame': 58271 obs. of 29 variables: >> $ i

Re: [R] Behavior of ordered factors in glm

2008-01-05 Thread David Winsemius
David Winsemius <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I have a variable which is roughly age categories in decades. In the > original data, it came in coded: >> str(xxx) > 'data.frame': 58271 obs. of 29 variables: > $ issuecat : Factor w/ 5 levels "0 - 39","40 - 49",..: 1 1

[R] Behavior of ordered factors in glm

2008-01-05 Thread David Winsemius
I have a variable which is roughly age categories in decades. In the original data, it came in coded: > str(xxx) 'data.frame': 58271 obs. of 29 variables: $ issuecat : Factor w/ 5 levels "0 - 39","40 - 49",..: 1 1 1 1... snip I then defined issuecat as ordered: > xxx$issuecat<-as.ordered(x