[R] puzzle about contrasts

2008-09-09 Thread Kenneth Knoblauch
Hi, I'm trying to redefine the contrasts for a linear model. With a 2 level factor, x, with levels A and B, a two level factor outputs A and B - A from an lm fit, say lm(y ~ x). I would like to set the contrasts so that the coefficients output are -0.5 (A + B) and B - A, but I can't get the sign

Re: [R] difference between assignment syntax <- vs =

2009-02-23 Thread Kenneth Knoblauch
It's easier to read. Better machine-human interaction. ergonomic: (esp. of workplace design) intended to provide optimum comfort and to avoid stress or injury. Quoting Wacek Kusnierczyk : Ken Knoblauch wrote: Wacek Kusnierczyk idi.ntnu.no> writes: Thomas Lumley wrote: Although it's

[R] length 1 offset in glm

2009-02-23 Thread Kenneth Knoblauch
Hi, I'm trying to use an offset with glm. According to the glm man page offset ... This should be NULL or a numeric vector of length either one or equal to the number of cases. ... but with the following example, I get an error if the offset is of length 1 c1 <- structure(list(Contr = c(0.