Extract Confidence Interval

Hello everyone,

I am new to EEG preprocessing and till now I managed to get my evoked potentials.

However, they seem a little noisy and therefore I wanted to check if the components I observe are really existing or not.

For this, I want to look for each subject, if its evoked potential and its 95% CI (calculated over epochs) is above or below 0 for a certain amount of time or not.

I know how to plot the 95% CI with epochs.plot_image() or plot_compare_evokeds() which have a CI argument.

My question is : is there any function to extract the CI calculated by plot_compare_evokeds() ? Or should I compute these CI by myself ? Is there any procedure example to compute this CI by hand using bootstrap ?

Thank you very much for your help.

I suggest you extract the data from the epochs as a 3D array of (epochs X channels X timepoints) via the .get_data method.

In a next step you could write your own function to compute the 95% CI for each timepoint and channel (over epochs), ending up with a 2D array of (channels X timepoints).

You could modify the fuction here: python - Compute a confidence interval from sample data - Stack Overflow