Plotting conditions - LIMO-EEG-Toolbox/limo_tools GitHub Wiki
Random Effect - Basic Stats - Central tendency and CI
In this section, we review how to plot a given condition using the LIMO EEG tools. We first look at simply plotting the data (beta values) that reflect the statistics that you use. Then we will look at plotting the EEG data that reflect the beta values used in the statistics.
What are the CI?
For each summary stat (e.g. the mean) we also plot the 95% Highest Density Intervals. These are generated using a Bayesian bootstrap. This means that for a given value, you can see the 95% probability the value is in that interval.
Summary stats for beta values
Random effect analyses are performed on betas values and therefore, if you want to show the data you want to show the beta values (or contrasts).
Pre-requisite
You should have a text file listing all the beta files (this is created automatically if you use the LIMO Batch). The alternative is to select manually all files one by one, which is not recommended.
such text file looks like this
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S1\GLM_WLS_Time_Channels\Betas.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S2\GLM_WLS_Time_Channels\Betas.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S3\GLM_WLS_Time_Channels\Betas.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S4\GLM_WLS_Time_Channels\Betas.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S5\GLM_WLS_Time_Channels\Betas.mat
computing the average Betas
- Step 1: load the random effect menu, select the expected channel files and click the 'Central tendency and CI' button.
- Step 2: Type of analysis, select 'Betas' and then chose what summary statistics you want to use. Since we want to show what is used in the analysis, we select 'Trimmed means' (except for repeated measures ANOVA for which we select Mean, because for the moment it works on classic averages).
- Step 3: 'which parameter to test? e.g. [1 3]' here we assume that all designs have columns in common, for example column 1 represent condition 1 and column 2 represents condition 2. Choose which condition you want - if you enter several columns like [1 2 4 5] it will compute the average for each condition/column of the design matrices.
- Step 4: select fill brain analysis or enter a specific channel (useful for ICA) and type the name of the file to save (eg myname)
Plotting betas with 95% CI
- Step 1: click the 'Central tendency and CI' button and select myname_Trimmed_mean_of_Betas.mat (or mymane_Mean_of_Betas.mat)
- Step 2: answer questions, which variables if you computed several summary stats, and which channels
- Step 3: reselect a file (e.g. myname_Trimmed_mean_of_Betas.mat) and answer questions - when you are done simply cancel the selection
By iteratively asking you to select files, you can compare conditions (e.g. mean beta values condition 1 and 2), summary stats (e.g. mean vs. trimmed mean) or channels (left vs right channels).
What to plot for my group level analysis
from 1st level OLS: mean within subjects, trimmed mean between subjects (mean for repeated measures until we have a good robust solution)
from 1st level WLS: weighted mean within subjects, trimmed mean between subjects (mean for repeated measures until we have a good robust solution)
What is saved on the drive?
(myname)(stat)_of_Betas.mat -- this file is a structure called Data.
Data.stat contains the summary statistics. For instance Data.mean contains in the last dimension the lower bound of the CI, mean and upper bound of the CI for a given Beta (column of the design matrix).
Data.limo contains info needed to build a meaningful plot (time, sampling, channels).
_(myname)_single_subjects_Betas.mat -- this file is a structure called Data
Data.data contains the betas values of all subjects for the condition selected
Data.limo contains info needed to build a meaningful plot (time, sampling, channels).
Summary stats for ERP data
Pre-requisite
You should have a text file listing all the beta files (this is created automatically if you use the LIMO Batch). The alternative is to select manually all files one by one, which is not recommended.
such text file looks like this
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S1\GLM_WLS_Time_Channels\LIMO.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S2\GLM_WLS_Time_Channels\LIMO.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S3\GLM_WLS_Time_Channels\LIMO.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S4\GLM_WLS_Time_Channels\LIMO.mat
E:\My_Documents\MATLAB\limo_eeg_to_do\Continuous_design\S5\GLM_WLS_Time_Channels\LIMO.mat
computing the average ERP
- Step 1: load the random effect menu, select the expected channel files and click the 'Central tendency and CI' button.
- Step 2: select if you want to estimate individual condition or pool conditions together (e.g. average ERP for conditions 1 and 2 together)
- Step 3: 'which parameter to test? e.g. [1 3]' here we assume that all designs have columns in common, for example column 1 represent condition 1 and column 2 represents condition 2. Choose which condition you want - if you enter several columns like [1 2 4 5] it will compute the average for each condition/column of the design matrices. Note the column coding a continuous regressors cannot be averaged (since by definition values change trial to trial, we cannot make an ERP). Finally select full scalp or indicate a single channel
- Step 4: a the new GUI select the 1st and 2nd level summary statistics. In most cases, the 1st level is (Weighted) Means and 2nd level is Trimmed Means (or Means for repeated measures ANOVA). Then indicate if you want to use the weights for the the 1st level analysis (yes in general). Note if you have used an OLS, the weights are equal to 1 for each trial so that selection has no consequences. Finally, input the name under which to save the data.
Plotting ERPs with 95% CI
- Step 1: click the 'Central tendency and CI' button and select myname_Mean_of_Trimmed_mean.mat (or mymane_Mean_of_Mean.mat)
- Step 2: answer questions, which variables if you computed several summary stats, and which channels
- Step 3: reselect a file and answer questions - when you are done simply cancel the selection
Plotting single subjects' summary statistics.
The same principle applies to plot single subjects, simply select the file called myname_single_subjects_xxx.mat.
What is saved on the drive?
(myname)(stat1)of(stat2).mat (for instance myname_Means_of_Means.mat) -- this file is a structure called Data
Data.stat contains the summary statistics. For instance Data.mean contains in the last dimension the lower bound of the CI, mean and upper bound of the CI for a given Beta (column of the design matrix).
Data.limo contains info needed to build a meaningful plot (time, sampling, channels).
_(myname)single_subjects(stat1).mat (for instance myname_single_subjects_Means.mat) -- this file is a structure called Data
Data.stat contains the summary statistics. For instance Data.mean contains in the last dimension the average of each subject.
Data.limo contains info needed to build a meaningful plot (time, sampling, channels).