I have hierarchical data with three categorical levels: group, person, and cell. In group A, B and C I have some unequal number of people. For each person a to zzz I have some unequal number of cells. For each cell I have a continuous measurement x.
I want to compare this continuous measurement between groups, and allow for a random difference between people (and implicitly also between cells of course). As you can see I have no continuous explaining variable like time or concentration or such. I really only have that single value, there is no slope or line that can be fitted to this, it would be just an 'intercept' for each group.
I wanted to use a mixed model because it can handle hierarchy. Is it appropriate to use a mixed model in my case (where the 'line' is a point at the intercept)?
I have found some other people in similar situations, but the basic question of is this even valid does not get treated, and I dont think the answer is trivial. Especially after having tried to perform the fit, which I show below.
If I assume this approach is valid, and I perform it the way I think it should work, the results dont make sense to me. Here I try to explain cell numeric value x (intercept only) with factor group, and allow a random effect (intercept) per person:
fit = lme(cellx ~ group, random = ~1|person, data = longformatmeasurements) coef(fit) (Intercept) groupB groupC a -0.8272526 -0.04870979 0.02885113 b -0.5515026 -0.04870979 0.02885113 c -0.7333176 -0.04870979 0.02885113 d -0.5902652 -0.04870979 0.02885113 e -0.5966660 -0.04870979 0.02885113 ... zzz-0.4644939 -0.04870979 0.02885113
I already find this strange,why does every person have a coefficient for every group? An where is group A?
Then if I look at the summary:
summary(fit) Linear mixed-effects model fit by REML Data: longformatmeasurements AIC BIC logLik 1254.006 1282.229 -622.0032 Random effects: Formula: ~1 | person (Intercept) Residual StdDev: 0.1592464 0.3174893 Fixed effects: cellx ~ group Value Std.Error DF t-value p-value (Intercept) -0.6814135 0.05680689 2054 -11.995260 0.0000 groupB -0.0487098 0.06878922 35 -0.708102 0.4836 groupC 0.0288511 0.07607308 35 0.379255 0.7068 Correlation: (Intr) groupB groupB -0.826 groupC -0.747 0.617 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -6.5791412 -0.3009672 0.2738938 0.6191442 1.7675351 Number of Observations: 2092 Number of Groups: 38
Where is group A? Why do groups B and C have the number of people minus the number of groups as degrees of freedom, but is group A neglected and does 'intercept' get a degree of freedom for every single cell I measured? Do I just use the wrong syntax or is this just not possible? It looks like a slope is fitted between groups, but no other syntax that I tried is accepted by the function, except
lme(cellx ~ group+0, random = ~1|person, data = longformatmeasurements), which does give a random intercept per person, but also a slope for every group and person.