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

Peter Dalgaard wrote:
Actually, notice that you are averaging identical values, so the "mean"
in the tapply is slightly misleading.
Notice also that the intercept may be defined even when _no_
observations have zero entries in the design matrix. This is the usual case in linear regression, for instance, but it can happen in factorial designs (unbalanced, or using other than treatment contrasts) as well.

Thanks for the answers.
Still I am not totally convinced about the interpretation of intercept as a mean of fitted values for group belonging to first level of each factor (those having 0 in all columuns in matrix.models, except the first column) because the reasoning seems to me a little cirucular. Being the intercept value the expected value for that group and, as Peter point out, being the same value for all observations in the group it seem clear that it intercept it is the mean of these value.

It is not completeley clear to me why (in some cases, not always) the intercept is not equal to the mean of the first group of raw data.

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.

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".

--
David Winsemius




Sorry if I am annoying with this issue... but I found in several books about R and also in this same mailing list that intercept *should* be equal to the mean of the first group.

Thanks
Stefano




--
======================================================================
Stefano Leonardi
Dipartimento di Scienze Ambientali
Universita` di Parma                E-mail: stefano.leona...@unipr.it
Viale Usberti 11/A                            Phone : +39-0521-905659
43100 PARMA  (Italy)                          Fax   : +39-0521-905402

______________________________________________
R-help@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.

______________________________________________
R-help@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.

Reply via email to