Re: [R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Mark Difford
Hi Gavin, > ... In this instance, you don't want to be working with lm. You can use > lm.fit which returns an object with $coefficients, so I would guess you > need something like this (not tested) ... & more ... That's a great help, many thank's for walking me through it; that's the stuff I ne

Re: [R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Gavin Simpson
On Wed, 2007-12-12 at 06:46 -0800, Mark Difford wrote: > Hi Gavin, Berwin, > > Thanks for your detailed replies. I'll make a general reply, if you don't > mind. > > To reiterate, my main point is that if model.matrix() can be used in this > way, then lm() shouldn't add an intercept. > > >> ...

Re: [R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Mark Difford
Hi Gavin, Berwin, Thanks for your detailed replies. I'll make a general reply, if you don't mind. To reiterate, my main point is that if model.matrix() can be used in this way, then lm() shouldn't add an intercept. >> ... lm(Gas ~ model.matrix(~ Insul/Temp - 1), data = whiteside) And the

Re: [R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Gavin Simpson
On Wed, 2007-12-12 at 02:05 -0800, Mark Difford wrote: > Dear List-members, > > Hopefully someone will help through my confusion: > > In order to get the same coefficients as we get from the following > > ## > require (MASS) > summary ( lm(Gas ~ Insul/Temp - 1, data = whiteside) ) > >

Re: [R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Berwin A Turlach
G'day Mark, On Wed, 12 Dec 2007 02:05:54 -0800 (PST) Mark Difford <[EMAIL PROTECTED]> wrote: > In order to get the same coefficients as we get from the following [...] > we need to do the following (if we use model.matrix to specify the > model) By why would you want to do this? > ## > summary

Re: [R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Mark Difford
Whoops! Sorry, forgot my session stuff, just in case ... R version 2.6.1 RC (2007-11-22 r43520) i386-pc-mingw32 locale: LC_COLLATE=English_South Africa.1252;LC_CTYPE=English_South Africa.1252;LC_MONETARY=English_South Africa.1252;LC_NUMERIC=C;LC_TIME=English_South Africa.1252 attached base p

[R] lm/model.matrix confusion (? bug)

2007-12-12 Thread Mark Difford
Dear List-members, Hopefully someone will help through my confusion: In order to get the same coefficients as we get from the following ## require (MASS) summary ( lm(Gas ~ Insul/Temp - 1, data = whiteside) ) .. we need to do the following (if we use model.matrix to specif