[R] Trouble about the interpretation of intercept in lm models

David Winsemius dwinsemius at comcast.net
Wed Jan 14 00:15:39 CET 2009


On Jan 13, 2009, at 5:54 PM, Stefano Leonardi wrote:

> David Winsemius wrote:
>> It would be so *if* you had estimated a saturated model, but you  
>> did not. Your fit
>> of Y|A values is adjusted for the B values.
> Thank you.
> What do you exactly mean by "Y|A values is adjusted for the B values"?

Another way of expressing it ...  the fit of Y|A in the A levels is a  
weighted average of Y|A,B=0, Y|A,B=1, and Y|A,B=2.
>
>
> And Yes. It works! Using the interaction I got what I expected as  
> intercept.

And, if you check, in all of the other possible combinations of A and B.

>
>
> Thanks
> Stefano
>> Try instead with lm(Y ~ A * B). You should get intercept (1), main  
>> effects(1+2) and
>> interaction terms(2) which should total the number of groups.  
>> Appropriately combined,
>> these estimates will now exactly fit the "raw values".
>
> -- 
> ======================================================================
> Stefano Leonardi
> Dipartimento di Scienze Ambientali
> Universita` di Parma                E-mail: stefano.leonardi at unipr.it
> Viale Usberti 11/A                            Phone : +39-0521-905659
> 43100 PARMA  (Italy)                          Fax   : +39-0521-905402
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list