Re: [R] contr.treatments query

2008-05-20 Thread Ted Harding
Apologies -- I have just observed my oversight below! Please ignore the message below. Ted. On 20-May-08 09:14:30, Ted Harding wrote: > On 20-May-08 06:10:48, Prof Brian Ripley wrote: >>>From ?contrasts >> Usage: >> contrasts(x, how.many) <- value >> ... >> how.many: How many contrasts shoul

Re: [R] contr.treatments query

2008-05-20 Thread Ted Harding
On 20-May-08 06:10:48, Prof Brian Ripley wrote: >>From ?contrasts > Usage: > contrasts(x, how.many) <- value > ... > how.many: How many contrasts should be made. Defaults to one less than >the number of levels of 'x'. This need not be the same as >the number of column

Re: [R] contr.treatments query

2008-05-19 Thread Prof Brian Ripley
From ?contrasts Usage: contrasts(x, how.many) <- value ... how.many: How many contrasts should be made. Defaults to one less than the number of levels of 'x'. This need not be the same as the number of columns of 'ctr'. so that is 2 in your example, and it takes the

[R] contr.treatments query

2008-05-19 Thread Ted Harding
Hi Folks, I'm a bit puzzled by the following (example): N<-factor(sample(c(1,2,3),1000,replace=TRUE)) unique(N) # [1] 3 2 1 # Levels: 1 2 3 So far so good. Now: contrasts(N)<-contr.treatment(3, base=1, contrasts=FALSE) contrasts(N) # 1 2 # 1 1 0 # 2 0 1 # 3 0 0 whereas: contr.treatment(3, ba