Re: [R] Interaction factor and numeric variable versus separate

2007-08-08 Thread Sven Garbade
Thanks to all for the very helpful replies the reference to a chapter in MASS! Sven On Tue, 2007-08-07 at 12:07 -0400, Gabor Grothendieck wrote: Also check this post https://stat.ethz.ch/pipermail/r-help/2007-May/132866.html for a number of formulations. On 8/7/07, Ted Harding [EMAIL

[R] Interaction factor and numeric variable versus separate regressions

2007-08-07 Thread Sven Garbade
Dear list members, I have problems to interpret the coefficients from a lm model involving the interaction of a numeric and factor variable compared to separate lm models for each level of the factor variable. ## data: y1 - rnorm(20) + 6.8 y2 - rnorm(20) + (1:20*1.7 + 1) y3 - rnorm(20) +

Re: [R] Interaction factor and numeric variable versus separate regressions

2007-08-07 Thread Gabor Grothendieck
In the single model all three levels share the same intercept which means that the slope must change to accomodate it whereas in the three separate models they each have their own intercept. Try looking at it graphically and note how the black dotted lines are all forced to go through the same

Re: [R] Interaction factor and numeric variable versus separate

2007-08-07 Thread Ted Harding
On 07-Aug-07 15:34:13, Gabor Grothendieck wrote: In the single model all three levels share the same intercept which means that the slope must change to accomodate it whereas in the three separate models they each have their own intercept. I think this arose because of the formulation of the

Re: [R] Interaction factor and numeric variable versus separate

2007-08-07 Thread Gabor Grothendieck
Also check this post https://stat.ethz.ch/pipermail/r-help/2007-May/132866.html for a number of formulations. On 8/7/07, Ted Harding [EMAIL PROTECTED] wrote: On 07-Aug-07 15:34:13, Gabor Grothendieck wrote: In the single model all three levels share the same intercept which means that the

Re: [R] Interaction factor and numeric variable versus separate regressions

2007-08-07 Thread Prof Brian Ripley
These are not the same model. You want x*f, and then you will find the differences in intercepts and slopes from group 1 as the coefficients. Remember too that the combined model pools error variances and the separate model has separate error variance for each group. To understand model