On Sat, Apr 5, 2008 at 10:14 PM, Ken Beath <kjbeath at kagi.com> wrote:
On 05/04/2008, at 12:05 AM, Sebastian P. Luque wrote:
On Fri, 4 Apr 2008 07:17:36 -0500,
"Douglas Bates" <bates at stat.wisc.edu> wrote:
[...]
I'm not sure that I understand what you mean by "treatment being
nested within community". Does this mean that there are really 8
different treatments because treatment 1 in community A is
different
from treatment 1 in community B? If so, then it would make sense
to
me to simply create a new factor that is the interaction of
treatment
and community.
I was not employing the term "nested" properly. The number of
levels
for both community and treatment are 2 and 4, respectively, just
as in
the example. The same 4 treatments were used in both communties, so
in
fact, treatment is crossed with community, not nested. However,
subjects are nested within communities because each subject
belongs to
one community only, yet received all 4 treatments. Sorry for this
confusion.
Once they are considered fixed effects, concepts of crossing and
nesting are irrelevant. They are simply covariates. So a model of the
form n ~ treatment + community +(1|id) or if the treatment effect is
allowed to vary between communities n ~ treatment *community +(1|id)
is appropriate. The main problem is your subject id are not unique.
You will need to define a new id.
I agree with everything up to here.
The easiest way is to add a
different large number to id depending on community.
That approach contradicts your later advice to represent a factor
variable as a factor in R. If id is a factor (as it should be) you
can't add a large number to it.