-
Notifications
You must be signed in to change notification settings - Fork 27
Skipping 1st level analyses
Although LIMO EEG is designed to work as a hierarchical model, you could use functions of the 2nd level analysis directly. What might be good a reason for that? you simply do not have any conditions. Let's say you do simple AEP or VEP in two groups, controls and patients. There is nothing to model at the 1st level. The solution is to create averages for each subject in EEGLAB and then concatenate those averages for LIMO EEG.
At the second level, we have a series of low level functions to perform robust statistics. These are however not convenient to use because you still need to create bootstrap files, tfce files, channel locations, etc in order to use the cluster statistics and the visualization tools.
For each subject, use EEGLAB to create your average responses, being ERP, spectra or ERSP. To simplify you work, use channel interpolation which will make all matrices of the same size. LIMO EEG handles NaN values, so if you are good at programming with Matlab you can create matrices of NaN of a given size (typically of the number of channel or independent components), and fill only for available data. That would work too.
At the 2nd level, LIMO EEG asks users to pick up Beta files or con files. Once this is done, LIMO EEG build matrices with all the subjects (this is done inside limo_random_select.m). You job is thus to build and save just that. If you use ERP or spectrum, the dimension is channel x time or frequency x subject. For instance, if you have 64 channels and 100 time frames, and you have 10 subjects. You will have a matrix of 64 x 100 x 10. If you use ERSP, the dimension is channel x frequency x time x subject.
For a one sample t-test, you build a single matrix Yr. This is the matrix used. For a regression analysis, a N-way ANOVA or an ANCOVA, you build a single matrix Y. A new matrix Yr in which subjects are reordered following the design will be created For a two-samples t-test, you build two matrices, one per group, Y1r and Y2r. These are the matrices used.
It's now time to create a LIMO.mat file coresponding to your design. Follow the link and a create a structure as shown. This will tell information about channels, time/frequency, etc.
With steps 1, you have done the equivalent of a 1st level model. With steps 2 and 3, you have performed the job of limo_random_select.m. Now you simply have to call limo_random_robust.m and this will compute the 2nd level with boostrap/tfce and you will be able to use the visualization tools (Results GUI).
_ load Yr; limo_random_robust(1,Yr,1,1000,1)_ this will do a one sample t-test on the 20% trimmed mean with 1000 bootstrap and compute tfce transforms.
_ load Y; limo_random_robust(4,Y,X,1,1000,1)_ this will do a regression analysis with 1000 bootstrap and compute tfce transforms. X is your design matrix with the regressors across subjects, don't forget to include a column of ones for the intercept (in LIMO EEG, this is the last column).
_ load Y1r; load Y2r; limo_random_robust(2,Y1r,Y2r,1,1000,1)_ this will do a Yuen two samples t-test (i.e. t-test on 20% trimmed means) with 1000 bootstrap and compute tfce transforms.
_ load Yr; load LIMO; limo_random_robust(5,Yr,cat,cont,LIMO,1000,1)_ this will do a N-way ANOVA/ANCOVA with 1000 bootstrap and compute tfce transforms. 'cat' is a vector that described your subjects (e.g. 1 1 1 1 1 2 2 2 2, or even 1 2 1 2 1 2). 'cont' is the vector/matrix of continuous regressors across subjects (for ANCOVA). limo_random_select.m will build the design matrix based on cat and cont are you will have to validate it (pop up) before it performs the analysis.
At the group level all is left is paired t-test and repeated measures ANOVA. That means you have multiple conditions and thus we recommend doing a hierarchical approach. Any other more complex design likely require modeling at the subject level as well.
Downsampling or not before analyzing
Defining conditions defining
~ categorical.txt ~continuous.txt
EEGLAB-STUDY: run, session, condition and group
Basic Stats: LIMO tests and CI
Repeated measures ANOVA
Results in the workspace
Results in LIMO.cache
Checking data under the plots
Reordering plots
Compute & Plot conditions
Compute & Plot differences
Channel neighbourhood
Editing a neighbourhood matrix
Scripting 1st level
Debugging 1st level errors
Skip 1st level
Scripting 2nd level
Getting stats results with a script