Question using anovan for two way repeated measures ANOVA

I am trying to run an analysis on my epilepsy data and could use some help. I have thirteen subjects from which I have collected connectivity data, and I am trying to run a two-way repeated measures ANOVA with two within-subject factors. I have a connectivity score which is my dependent variable. I also have a subject identifier variable 'subject' and two categorical variables which are 'state' (values = 1,2,3,4) corresponding to the time state at which the connectivity score was collected and 'region' (values = 1,2,3,4) corresponding to the epileptogenicity of the region from which the connectivity score was collected. For each patient/state/region combination, there are many (tens to hundreds of) measurements, not just one, and the number of measurements is not the same from one combination of patient/state/region to the next (which is why I avoided using ranova since I don't know how I would get all the data for one subject in one row).
I have created a matrix a, in which the first column is the connectivity score, the second column is subject identifier, the third column is the categorical 'state' variable, and the fourth variable is the cateogorical 'region' variable. Is the following code correct for running this analysis?
p = anovan(a(:,1),{a(:,2) a(:,3) a(:,4)},'model',2,'varnames',{'subject','state','region'},'random',1);

4 Comments

Why are there multiple measurements for each patient-state-region condition? The only experiment factors you've mentioned are state and region. The ANOVA will test for a state main effect on the connectivity score, a region main effect on connectively score, and a State x Region interaction effect on the connectivilty score.
If multiple measurements were taken just to smooth over inaccuracies or variability in the measuring instrument, then you can just collapse the connectivity scores into a single measure for each patient-state-region condition, and proceed with the anova.
if there is some characteristic in particular that lies within the multiple measurements -- such as measurements made at different points in time or at different physical locations -- then that characteristic should probably be added as an experimental factor.
Thank you so much for your feedback.
The measurements were made at different time points and channels, but all within a certain "state" and "region". To clarify, I have 30 minutes of resting-state data that I break into 30 second epochs, so I have a measurement for each 30 second epoch, but these are all within the state "resting-state". I also have multiple EEG channels that compose one "region". Would it be better to average down all of these measurents into one value per patient/state/region combination before doing the ANOVA? I have always thought it wasn't a good idea to run ANOVA on summary statistics.
Well, I think my previous suggests stands. If you have 30-second epochs spanning 30 minutes, that's potentially another factor called "epoch" with 60 levels. Is there a particular research interest in testing for an "epoch effect" on the connectivity score? Maybe, maybe not. But these measurements are only for one of the four states (resting) so perhaps not.
Is it not the case that multiple EEG channels of data are gathered to smooth over differences and get a more stable and reliable measure? If that's the case, I see no reason why you can't just work with the mean of the measures over the different channels.
Really, all these issues should be considered and decided on before running an experiment. As a start, why not just collapse the data as I suggested and look for the main effects of state and region and a State x Region interaction effect. In this case you have a 4 x 4 within-subjects design with 13 participants. You could use ranova or anovan.
Thank you very much, I appreciate your time!

Sign in to comment.

Answers (0)

Products

Release

R2021a

Asked:

on 25 Feb 2022

Commented:

on 25 Feb 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!