Thanks for your quick reply.
>>>>"In particular, you will only have two levels of gender, even if you

consider more schools or districts. Trying to estimate a variance

from a single contrast is difficult.">>>>
I have three questions:
1.do you mean that if there are more levels of gender (make an assumption) it is reasonable to consider gender as a random effect in my case? and if so, how many levels are enough for me to estimate a variance generally.
2.furthermore,in my study, I want to know the average performace for male and female,however there would be autocorrelation among students in same school and district,I just use the nested random effect (1/district/school) to control for autocorrelation so as to get a robust evaluation for male and female.it may be reasonable to construct model like:lmer(score~gender+(1|district/school),data);however,I am also interested in which characteristic for male and female(e.g. mean Psychological endurance for male and female) can explain the variance between male and female, is there any suggestion for my case?
3.in the case of religions(6 levels) instead of gender , whether the specification of all the models was reasonable and correct in lmer.Can I take this as a cross random effect: lmer(score~1+(1|religions)+(1/district/school),data).
thankssincerely,lei chen
2009/3/31 chenlei :> Dear all and dr.Bates,
> I have a dataset with students nested in schools and also schools belong
> to each district. The data was explicitly nested as previous examples.
> In my case, I don't care the variance between schools or district,and I
> just want to assess the effect of gender on stuedents'
> scores,traditionally,the model can be specified in lmer like :
> lmer(score~gender+(1|district/school),data)
> notes: the gender was a factor(male,female)
> in my study ,I want to know the variance between genders,and I also use some
> covariates at gender level to explain the variance between genders.
It doesn't make sense to me to model the effect of gender as a random
effect. I think of random effects as being associated with particular
experimental or observational units. On the other hand, the levels of
gender, male and female, are fixed. This type of factor is the
archetypal example of a factor for which you would use fixed effects.
In particular, you will only have two levels of gender, even if you
consider more schools or districts. Trying to estimate a variance
from a single contrast is difficult.
> I construct the unconditional model and conditional models like these:
> unconditional model :lmer(score~1+(1|gender)+(1/district/school),data)
> conditional model :lmer(score~1+IQ+(1|gender)+(1/district/school),data)
> the IQ indicates the mean IQ scores for different genders.
> What I want to confirm is whether the specification of all the models was
> reasonable and correct in lmer.Thanks.
> yours,
> Lei Chen
[[alternative HTML version deleted]]