Skip to content
Prev 16879 / 20628 Next

Analyzing similarity scores between subjects

This is a tough problem! And I'm not sure I can solve it without the
data (and I am not willing to go that far), or ever. But here are some
thoughts. If I had these data, I would not automatically think of
using a multi-level model, but, the more I think about it, the more
sense it makes. (And I would first look at something really simple to
see if my hypothesis has a chance of being correct.)

First, 4 time points may not be enough to treat time as a random
effect. It might (or might not) make sense to treat time as a fixed
effect and look at its interaction with type. It may be that time 
segment does not matter at all. But if there is an interaction you
need to worry about coding the variables so that you can still
interpret the main effect of type.

Second, it seems to me that you need random-effect terms for both
subjects in each pair. And you should use only unique pairs, so that
you do not double-count (as you realize).

Thus, the model I would think of would be something like:

lmer(dist_ij ~ type_ij*segment + (1|sub_i) + (1|sub_j))

I'm not sure about which random slopes to include, if any, but with
all of them it would be something like:

lmer(dist_ij ~ type_ij*segment + (1+type*segment|sub_i) + (1+type*segment|sub_j))

Maybe you don't need the 1 in the last grouping term.

I'm just using the "ij" notation to indicate that you have a matrix or
data frame with one row for each unique pair in each segment.

I'm not sure whether "segment" should be a number or a factor.

Jon
On 08/08/18 13:22, Han Zhang wrote: