[R-sig-ME] A queation about random effect of lme4 package

Paul Johnson p@u|@john@on @end|ng |rom g|@@gow@@c@uk
Thu Sep 2 14:10:46 CEST 2021


Hi Lina,

If you have a number of grouping factors, the lme4 model-fitting functions will allow variation in the intercept using the syntax (e.g. for nested random effects):

... + (1 | village) + (1 | district) + (1 | region)

(here villages sampled within districts within regions). It's important to make sure all the nested villages and districts have unique names, e.g. if every district has villages A, B, C, ... this won't work. There is a nesting syntax, but it’s easier to use unique names. I think "(1|V5:V6:V7:V8.." does some kind of partial nesting but I never use this syntax and don't know exactly how it works.

The same syntax works for other sampling designs, e.g. crossed random effects (e.g. a sample of exam questions taken by a sample of students, or a panel of clinicians rating a sample of patients for disease severity).

It's very unusual to have large numbers of random effects (such as 10 in your code) in a model and usually lme4 will struggle to estimate them all. I can't comment on the appropriateness of your model for your data as I don't know anything about the specifics.

Best wishes,
Paul


On 02/09/2021, 12:48, "R-sig-mixed-models on behalf of linabu using cau.edu.cn" <r-sig-mixed-models-bounces using r-project.org on behalf of linabu using cau.edu.cn> wrote:

    Dear Sir/Madam,

    Hope this email finds you well.
    I am writing to inquiry about the progects published on github: https://github.com/lme4/lme4. 
    I have multiple random variables, and I want to obtain a p-value of all the random variables, so how do I do that?  I don't know if this model (ranova(fm1<-lmer(V2 ~ V3 + V4 + (1|V5:V6:V7:V8:V9:V10:V11:V12:V13:V14) , data))) is correct. Is the design of random effect correct?
    Another question: If I want to compute every estimate of random effects, how can I design the model? Is this the model [lmer(V2~V3+V4+(1|V5)+(1|V6)+(1|V7)+(1|V8)+...+(1|V14, data))] correct? 
    I would appreciate your help.

    Yours sincerely,
    Lina

    	[[alternative HTML version deleted]]

    _______________________________________________
    R-sig-mixed-models using r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list