Is there an appropriate way to control for individual subject identity as a Random effect in a linear model if each data point arises from a pair of subjects (for example, how long it takes two individuals to complete a task together). I am considering designating a subject_A and a subject_B for each pair and then looking at the effect of subject identity in those groups (as in the R code below), but since the designation of subject_A and subject_B is arbitrary and the groupings would be artificial, this doesn't seem right (though I don't fully understand why...).

R code: lm(response ~ main_effect + (1|subject_A_in_pair) + (1|subject_B_in_pair))

Is there a more appropriate way to do this?

I should perhaps also point out that I think this issue would be a moot point if each subject has only contributed to one data point (i.e. each subject only participates in one pair), because in that case there's no way to tell how much each subject in the pair contributed to their data point. However, I have data where each subject contributes to more than one data point, though never with the same partner.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.