I am trying to regress a continuous brain anatomy measure with a behavioral parameter while accounting for age and sex effect. The difficulty I am facing is that I have for each subject two anatomical measures, one for each hemisphere:
Subject Anatomy measure Hemisphere Age Sex Behavior
1 1.2 1 22 2 16,2
1 1.5 2 22 2 16,2
2 1.7 1 25 1 19,3
2 1.8 2 25 1 19,3
How can perform the regression anatomy*behavior while taking into account this repeated measure problem ? I thought that the appropriate way to do that was to perform a linear mixed-effect regression with subjects as a fixed factor. However I am not sure this is a good solution. Does anyone know a function that would deal with repeated measure design for linear regression ?
Thanks in advance !