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
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
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
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
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
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
6 matches
Mail list logo