What is the Proper Notation for Multi-level Mixed Effects Models
34 ビュー (過去 30 日間)
古いコメントを表示
I am a little confused on the proper syntax/notation for multi-level mxied effects models and was wondering what the proper way to write the formula is for these in Matlab? The results for either syntax appear identical except the BLUP names from calling "randomEffects" are different.
From the Multilevel Mixed-Effects Modeling Using MATLAB where state is nested within region they use the syntax (1|REGION) + (1|STATE:REGION).
However, from the fitlme description where to "j th tomato type nested in the k th soil type" the notation used is (1|Soil) + (1|Soil:Tomato).
Thanks,
Seth
0 件のコメント
回答 (1 件)
Krishna
2023 年 12 月 28 日
Hello Seth,
In multilevel mixed-effects models, the notation can indeed be a bit confusing at first. However, the syntax you've mentioned for specifying random effects in MATLAB is correct for nested random effects. The notation (1|GROUP) specifies a random intercept for the variable GROUP. When you have nested random effects, you use the colon : to indicate the nesting.
Breaking down the first example you have given, (1|REGION) + (1|STATE: REGION) indicates that there are random intercepts for REGION and for STATE nested within REGION. This means that each STATE has a different intercept, and these intercepts can vary across REGION. For the second one (1|Soil) + (1|Soil: Tomato) suggests a similar structure where there are random intercepts for Soil and for Tomato types nested within Soil types. Each Tomato type within a Soil type can have a different intercept. In both cases, the syntax is specifying a two-level model where the second level is nested within the first. The results of your model should be the same regardless of the BLUP names, if the model structure is correctly specified. The BLUP (Best Linear Unbiased Predictor) names are just labels for the random effects, and while they might differ based on syntax, they should not affect the actual estimates of the fixed or random effects.
Please go through this documentation for more information,
Hope this helps.
3 件のコメント
S.C.
2024 年 6 月 4 日
I echo Richard's and Seth's confusions. Clarification from an authoritative source would be appreciated!
BM
2024 年 10 月 4 日
編集済み: BM
2024 年 10 月 4 日
I too would like some guidance on this because I am working with multiple levels of nesting. My intuition is that the A:B specifies an interaction, so the order does not matter (A*B = B*A). The upper level of the nesting is specified by the other random effect (1|A) which specifies that A is the highest level, and the other term (1|A:B) then puts B inside A, regardless of the order (A:B or B:A). I could be wrong. One way to test this is just to run it both ways, one with (1|A:B) and one with (1|B:A) and see if you get the different results. If not, then it doesn't matter and it's the other term (1|A) that matters.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!