Douglas Bates menyatakan bahwa model-model berikut ini setara "jika matriks varians-kovarians untuk efek acak bernilai vektor memiliki bentuk khusus, yang disebut simetri gabungan" ( slide 91 dalam presentasi ini ):
m1 <- lmer(y ~ factor + (0 + factor|group), data)
m2 <- lmer(y ~ factor + (1|group) + (1|group:factor), data)
Khususnya Bates menggunakan contoh ini:
library(lme4)
data("Machines", package = "MEMSS")
m1a <- lmer(score ~ Machine + (0 + Machine|Worker), Machines)
m2a <- lmer(score ~ Machine + (1|Worker) + (1|Worker:Machine), Machines)
dengan output yang sesuai:
print(m1a, corr = FALSE)
Linear mixed model fit by REML ['lmerMod']
Formula: score ~ Machine + (0 + Machine | Worker)
Data: Machines
REML criterion at convergence: 208.3112
Random effects:
Groups Name Std.Dev. Corr
Worker MachineA 4.0793
MachineB 8.6253 0.80
MachineC 4.3895 0.62 0.77
Residual 0.9616
Number of obs: 54, groups: Worker, 6
Fixed Effects:
(Intercept) MachineB MachineC
52.356 7.967 13.917
print(m2a, corr = FALSE)
Linear mixed model fit by REML ['lmerMod']
Formula: score ~ Machine + (1 | Worker) + (1 | Worker:Machine)
Data: Machines
REML criterion at convergence: 215.6876
Random effects:
Groups Name Std.Dev.
Worker:Machine (Intercept) 3.7295
Worker (Intercept) 4.7811
Residual 0.9616
Number of obs: 54, groups: Worker:Machine, 18; Worker, 6
Fixed Effects:
(Intercept) MachineB MachineC
52.356 7.967 13.917
Adakah yang bisa menjelaskan perbedaan antara model dan bagaimana m1
mengurangi ke m2
(diberikan simetri gabungan) dengan cara yang intuitif?
r
anova
mixed-model
repeated-measures
lme4-nlme
statmerkur
sumber
sumber
lme4
sintaks. Akan sangat membantu - & memperlebar kumpulan penjawab potensial - jika Anda menjelaskannya untuk orang yang belum terbiasalme4
.Jawaban:
m1
For your
m2
, the random effects decompose into:Where Z is as before,X=I6⊗19 is a design matrix that maps the random intercepts per worker onto observations, ωT=[ω1,A,ω1,B,ω1,C,…,ω6,A,ω6,B,ω6,C] is the 18-dimensional vector of random intercepts for every combination of machine and worker; and ηT=[η1,…,η6] is the 6-dimensional vector of random intercepts for worker. These are distributed as,
The marginal covariance structure ofΣ=σ2ωZZT+σ2ηXXT , so that the variance of a given observation is σ2ω+σ2η+σ2y , and the covariance between two observations from workers i,j and machines u,v is:
m2
isSo ...σ2θ≡σ2ω and τ2≡σ2η . If
m1
assumed compound symmetry (which it doesn't with your call to lmer, because the random effects covariance is unstructured).Brevity is not my strong point: this is all just a long, convoluted way of saying that each model has two variance parameters for the random effects, and are just two different ways of writing of the same "marginal" model.
In code ...
sumber