Sure thing! Just use the Subjects subpane of the Edit function to generate whatever grand averages you need in the PCA dataset and then plot them in View. Any such grand averages are what I call "adds", meaning they will be ignored when you conduct statistical tests and so forth. Joe
I added a column (Spec) to my current dataset to specify which of the two experimental groups participants belonged to. When I use the autoPCA feature, I have the option to include the "groups" Spec to my output, which helps me in identifying between-group differences on account of experimental group. I was wondering how I could plot the PCA factors for the two groups separately using the "View" function, as I seemingly only have the option to plot out individual participants or the grand average...
Works perfectly -- thank you so much! Best, Ha Jeong
It is handling the sessions as designed. It was a bug activated by the presence of sessions and also not having subject specs. I've included the fix in the 2.9975 release that I just posted. Cheers! Joe
I know you said you'd be posting another update soon, but I tried running the same analysis using version 2.9974 but got the same error: Starting AutoPCA. Window size and adjoining samples option for peak measures ignored. There are 26 factors that meet the minimum variance criterion of: 0.005. Index in position 1 exceeds array bounds. Error in ep_windowData (line 884) subSpecs(iSub,:)=EPdata.subjectSpecs(subSessList(1),:); Error in ep (line 7949) outputdata=ep_windowData(EPdata, chanGrp, inputcells,...
Thanks for getting back to me so quickly! Sure thing, I'll try using the most recent version and see if it fixes the error. Thank you, Ha Jeong
Hmmmm.... it should have been telling you there is a more recent version of the EP Toolkit. I'll have to look into that. In any case, the first thing you should do is update to the latest version (yours is two years old). I'm actually planning on posting another update tonite or tomorrow, but in any case it may fix your problem. If not, then let me know and we'll take it from there. I would need a copy of your .ept file to test. Joe
Hi Dr. Dien, I'm trying to do auto PCA to export peak data for analysis in an external statistical software. My EEG data were imported as text files, and I have separate sessions (2) for each subject; each session has 2 conditions. I ran temporospatial PCA on this dataset with no issues but am getting the below error message when trying to run auto PCA from the Window menu: Starting AutoPCA. Window size and adjoining samples option for peak measures ignored. There are 26 factors that meet the minimum...
I'm glad I was able to fix your bugs. I've just posted a new release with the fixes. Joe
Regarding the second problem, your EP Toolkit appears to be in a peculiar state. You appear to not have an EPwork directory? Were there any error messages in the Matlab Command Window beforehand?
Sorry for the problem! I need you to consult the section of the Tutorial on Bug Reports, especially the bit about sending me the ver information, before I can look into this. Cheers! Joe
Additional note: After restarting MATLAB (version 2024b), when I try to launch the ERP PCA Toolkit by typing ep, I immediately encounter the following error and the GUI fails to load: ep Unrecognized field name "dataset". Error in ep (line 1165) if ~isempty(EPdataset.dataset) && (~isfield(EPdataset.dataset,'lastChange')) I'm not sure whether this is due to an incompatibility between the variable initialization for EPdataset and the newer MATLAB version, or whether some data structure needs to be...
Hi, I encountered an error while using the ERP PCA Toolkit and would greatly appreciate your help in identifying the cause. Specifically, when I attempt to generate a topographic map (topo) via the GUI, the program throws the following error: Error while evaluating DestroyedObject Callback. Index exceeds the number of array elements. Index must not exceed 28. Error in ep_showTopos (line 1798) 'String',chanNames(EPtopos.nonRegChans)',... Error in ep (line 5464) ep_showTopos(str2num(get(EPmain.handles.view.startSamp,'string')),str2num(get(EPmain.handles.view.endSamp,'string')),......
I just sent you a link to a beta with the feature you requested. It'll be included in the next version release. Joe
Good request, I used to miss that too, but if you always generate a PCA/ICA component of your ERP, then a topolot of the peak latency is very representative as well.
That would be awesome, thank you!
Not currently possible, but I'd be happy to add it to the next release, which should come out maybe next week.
Hi Joe, I am having trouble figuring out how to display a topographic map that averages a time window. For example, I want to visualize the brain activity between 80-180 ms to look for an MMN. At the moment I can only figure out how to visualize one time point at a time. Thank you! Joey
oops, thanks for the reminder! I'm pretty close to another release. It'll be fixed. Thanks! Joe
ep; Error: The rest of the EP Toolkit is not on the path. Make sure to use the 'Add Folder' button rather than the 'Add with Subfolders' button. Just as an FYI, in case you don't know, but the error message it gives still says to do the exact opposite (at least in the version I am using currently, 2.996). Thanks.
Got it, thanks! I was looking under the View and Edit tabs.
In the Read pane, click on the dataset you want to delete. They're in red to remind you not to do this unless you really want to delete them!
Hello, I have done my first couple attempts at a PCA and realized I made some mistakes. I'd like to start fresh, but I can't seem to find an option to delete the PCAs or the dataset I used to run the PCA from the EP toolkit workspace. I've read over the tutorial PDF but cannot find any info on how to do this. Thanks!
Thanks! It is working now.
Okay, I just sent you a link to a beta version with the fix.
Hi Dr. Dien, thank you so much for your response! I have sent the ept. file and more explanations of the factor loading to your email at: jdien07@mac.com. Please let me know if anything else is needed! :)
Hi Shuyi, I'm not quite sure what you mean by "factor loadings for each participant for each component. "There is only one set of factor loadings for the entire dataset when you conduct a PCA. The Edit function provides the raw numbers if you use it to inspect a PCA result. Is that what you are asking for? As for the tsPCA.ept file, if you send me a copy of the file, I'd be happy to fix the problem.
Dear Dr Dien, I encountered a question during the revision process that requires me to provide the factor loadings for each participant for each component. Can you please guide me on where to find this information in the EP Toolbox? I believe I found the factor scores for each participant, but I'm having trouble locating the factor loadings. Also, I have encountered problems when tried to open an ept file that was generated two years ago (with Matlab and PCA toolkit). Do you have any thoughts how...
I appreciate the quick reply, thank you! I'll work on the compiling everything to submit the report. As a quick update, a colleague had a version of EP Toolkit from 2019 and I don't run into the same error with that, and it also doesn't appear to flag all of my channels as bad. So, I'm at least doing some data exploring with that at the moment.
No problem at all! I'll work on the compiling everything to submit the report. As a quick update, a colleague had a version of EP Toolkit from 2019 and I don't run into the same error with that, and it also doesn't appear to flag all of my channels as bad. So, I'm at least doing some data exploring with that at the moment.
Rank of data is zero? Something peculiar is going on, that's for sure! I'll need you to submit a full bug report so that I can look into it. At the start of the tutorial pdf is a section on bug reports that tells you what I'll need to troubleshoot.
Dr Dien (and other EP Toolkit users), I'm currently trying to run a tsPCA decomposition on averaged ERP data (34 data channels referenced to the averaged mastoids) from two different conditions. It appears that I can get the data read into EP Toolkit without any issue, but when I go to run the temporal PCA I get the error message below that seems to suggest that some data/parameter is missing somewhere. I'm not sure if the error is related to: * The Mastoid reference channels not being included in...
Dr Dien (and other EP Toolkit users), I'm currently trying to run a tsPCA decomposition on averaged ERP data (34 data channels referenced to the averaged mastoids) from two different conditions. It appears that I can get the data read into EP Toolkit without an issues, but when I go to run the temporal PCA I get the error message below that seems to suggest that some data/parameter is missing somewhere. I'm not sure if the error is related to: * The Mastoid reference channels not being included in...
I can see how the warning message could be ambiguous. I'll clarify it for the next release.
It doesn't sound like you followed the installation instructions. Please take another look at them. Cheers! Joe On 6/27/24 17:07, PJ Brancaleone wrote: I am attempting to launch the EP toolkit for the 1st time. I have downloaded the most recent version (EP_Toolkit 2993) and unzipped the contents into where I have my other EEG applications like eeglab as recommended in the tutorial pdf. Then, I opened Matlab and clicked "add to path" -> "Current folder", then tried to run the ep command. When I do,...
or to put it another way, it is telling you that you are supposed to use the "Add with Subfolders" button. Your not using it is in fact the problem. Be sure to read the instructions regarding EEGlab and FieldTrip as well.
It doesn't sound like you followed the installation instructions. Please take another look at them. Cheers! Joe
I am attempting to launch the EP toolkit for the 1st time. I have downloaded the most recent version (EP_Toolkit 2993) and unzipped the contents into where I have my other EEG applications like eeglab as recommended in the tutorial pdf. Then, I opened Matlab and clicked "add to path" -> "Current folder", then tried to run the ep command. When I do, it returns the following: Error: The rest of the EP Toolkit is not on the path. Did you use the 'Add with Subfolders' button rather than the 'Add Folder'...
If you mean the values of the factor pattern and factor structure matrices, you can obtain them using the Edit function.
thank you very much for your reply, I have a further question, is there any method to get the exact value of beta weight for every tempo factors over the time window?
In the case of the tutorial, this was handled by choosing the "autoPCA" option. It chooses the peak time point as the time window, which in this example was "192-196 ms." The "176-224 ms" you are quoting was for the windowing of the averaged data, not the PCA data. That would be chosen in the normal manner. In this case, the rationale was 25 ms on either side of 200 ms, for a 50ms long window, which is reasonable for an N2. If you're wondering why the numbers aren't multiples of five, it is because...
Dear Professor Dien I read the tutorial again, on the page 130, the introduction about " Windowing Subject Average Data", the introduction said "The time window also needs to be specified. Let's try a 176-224 ms window (although this tutorial dataset is too small to look for significant effects) by entering in samples 70 to 81". my question is how this time window "176-224 ms" was selected for tf04sp01?
Ah, that makes more sense! It depends on what kind of reliability you want. The EP Toolkit is already set up to provide SME and Dependibility measures for ERP measures. Truth to tell, I don't think either of these provide what you have in mind. They are both pretty specialized in their nature. PCA is layering another level of complexity, so I don't know of anyone who uses reliability measures with them, except for between session reliability (at the subject level). The EP Toolkit automatically provides...
I apologize for the delayed reply. My advisor was out of town and I wanted to wait until he came back so that I cold confirm with him before responding. I was mistaken and the PCA was applied to subject averages (average of all trials for a given condition within each subject) rather than individual trials. So, it seems like we won’t be able to use these data for split-half reliability. Sorry, I should have known this earlier. I guess we’d need to do the PCA at the item level to be able to look at...
Well, first I need you to be much more precise about how this dataset was generated. The devil is in the details, as they say. Please confirm that it was applied to individual trials, and then if so, describe how this was conducted. You're not describing a conventional EP Toolkit analysis, so there are many possibilities here.
Thank you for your quick response! I believe the PCA was applied to the individual trials. And, what we are trying to calculate is the reliability for the amplitude measures from the different temporospatial factors. With mean amplitude-based ERPs, we just compute the ERP for even and odd trials separately and then calculate split-half reliability. We weren’t sure if this type of thing would be possible for PCA derived factors (without physically conducting the PCA separately on the even and odd...
and which part of the statistics are you trying to do the split-half reliability on? The PCA solution itself or the ANOVAs?
Hi, sure! I'll need more information to fully respond though. So first of all, was your PCA applied to the subject averages or to the individual trials? And for the split-half reliability, do you indeed need the reliability at the trial level? I ask, because computing the PCA at the subject level, but then trying to do trial-level things with the average-level results would be tricky. Joe
Hello, I was wondering if you know of a good way to calculate split-half reliability of PCA temporal/spatial factors derived from the EP Toolkit? E.g., Is there a way we can export trial-level data for each of our conditions (in this case gains vs. losses in a monetary reward task)? Thank you!
No problem. Once the temporal PCA has been performed, it no longer matters what time points are chosen for the window. All time points reflect the same factor scores. You'll get the exact same p-values no matter what time points you choose. Please see my 2004 and 2012 papers for more explanation of the math behind this process. Joe
Dear Professor Dien I am sorry that I didn't clarify myself clearly. In the paper, as a quoted “Mean voltage data was extracted from two spatial regions of interest (ROI) defined by the selected temporospatial factor from the principal components analysis (TF01SF1-Island PCA; TF01SF1-Non-island PCA) over a time window defined with a 0.6 beta weight criterion... This gave a frontal ROI with a time window of 588–792 ms for the Island PCA and a posterior ROI with a time window of 612–796 ms for the...
Thanks for your kind words! I'm afraid I don't really understand your question. You set a window in the Windowing function. You enter in the start and end ms of the window you want.
Dear Professor Dien I am a newer with ERP and PCA analysis, while I was doing data analysis with my experiment, I found a paper using this toolbox to do the PCA analysis,which enlightened my data results. In this paper, the author described her process of PCA as follows: Following Dien et al. (2007)’s recommendations for principal components analysis of ERP data, we conducted a temporal PCA followed by a spatial independent components analysis (ICA) of each temporal component. ...Mean voltage data...
The problem has been sovled, and it works well with the fix. Thank you very much!
oops! oversight in the code generating cell means and standard errors for the output file. I'm sending you a fix.
Dear Prof Dien, I am trying to conduct a robust ANOVA analysis on my data with 3 groups(A, B, C) x 2 valence (pface, nface ) x 2 congruency (C, I). However, I receive the following error message when the level of between-subject factor is 3: Index exceeds the number of array elements. Index must not exceed 3. Error in ep_ADF (line 834) sampleN=sum(newNX(find(groupContrast{betweenGroup}))); Error in ep (line 8288) ep_ADF(Y, ANOVAdata.subjects, trimOption, EPmain.preferences.anova, ANOVAmethod, factorNames,...
Great! I run the complet procedure with the fix, from importing the average files to run the ANOVAs and everything is all right. Thank you very much!
Ah got it! Sorry, when I get a figure with things circled, I'm used to it being the "after" errors being highlighted, not the "before" good values. This was a bug due to the subject specs not being handled right when there are multiple sessions per subject. I just sent you the fix. Give it a try and let me know if you run into any further issues!
Hi. Yes, the .ept averaged and the PCA files are right. The error emerge when I 'window' the PCA file to analyze data with the AutoPCA option. The subjects specifications (group and sex) are incorrectly assigned in the output (.txt) file. You can see the differences in the screenshots copyed in the .docx file. Regards,
Okay, well my initial inspection shows no difference between the subject specs in the .ept average file and in the .ept PCA file. So what is the problem? There's no difference before and after the autoPCA as far as I can tell.
Hi, I've just added the required information: the original average file (ML_rec_12AV_reproc_2022_12.ept), and also the first-step temporal PCA file (ML_rec_12AV_ACPt_reproc_2022_12.ept). Moreover, I have added two doc files with useful (I hope) information, according to your indications for bug reports. Please, let me know if you need something else.
Hi, in order to troubleshoot, I need the before as well as the after, so to speak. The way it works is I run it through the same steps as you did and see at what point it goes awry. I can't do this if I don't have a copy of the average file that you performed the PCA upon. See the instructions in the Tutorial on how to perform a bug report.
Sorry, try this other site https://nubeusc-my.sharepoint.com/:f:/g/personal/rodriguez_holguin_usc_es/EnmraVRXVKFFufUP4sosXCkBBihUnkw1gjYRkLvnCQpZCw?e=UfCG2B Thanks! O 11/01/2023 ás 5:02, Joe Dien escribiu: Hi, sorry for the delay! I was out sick. I can't access your files because I don't have an account on your University's system. You need to set the file so that it is public access. Bad assignment of between-subject factor levels when windowing PCA data (AutoPCA) https://sourceforge.net/p/erppcatoolkit/discussion/767176/thread/2ff2a6655e/?limit=25#9993...
Hi, sorry for the delay! I was out sick. I can't access your files because I don't have an account on your University's system. You need to set the file so that it is public access.
Thanks in advance for your help!
Hi, Dien I've found a problem when windowing PCA data by AutoPCA with the specification of between-subject factors: the assignment (sex, group) to the cases is not correct. I'm not sure what I am doing bad. In the link below you can find (1) the spatiotemporal ACP file (.ept) and my electrode configuration file (.ced) to read it; (2) the output of the AutoPCA for the first factor, where the assignment of the between-subject levels to subjects is incorrect; and (3) a doc with some screen-shots, including...
Hi there, I am trying to run the PCA analysis by merging ERP formats to a single file using the single file mode function. However, the 'recognized function or variable 'inputFormat'. error message keeps showing up (see below) :-(. I suppose this is a tiny bug...but I have no clue how to solve this...Could anyone provide a clue? I am running the analysis in Windows 10 environment with Matlab version 2022a. Thank you so much in advance! HN *Loading summary information about datasets in working set...
That'd be a "depends" I'm afraid. So for example, a channel interpolation is only as good as the surrounding channels. Channels on the edge of the montage are more likely to have issues because of the missing information about what is outside of the montage. Choosing only channels in common avoids the interpolation issues but will rob the PCA of much of its power as temporal PCA relies heavily on the differences in topography across the channels to distinguish between ERP components, so the less...
Thank you so much for your response, I do have a small follow up question: 9 of the labs record with 64 channels, 4 can only record 32. Is it recommended to just use "similar" electrodes and then standardize them, or is it acceptable to interpolate the missing channels for the less dense setup? Thanks for your help
Yes, definitely standardize the recordings first. You can use the Edit function to do both. The Samples pane allows you to resample as desired and the Channel Coordinates button of the Overview pane allows you to interpolate the channels from one montage to another. Then you'll be ready to go!
We are planning to perform a PCA on selected ERPs using your toolkit on a consolidated EEG data from different labs. The data were collected using different recording systems, resulting in different sampling rates (500/512), electrode numbers (64/32) and electrode configurations. I was wondering what would be the best approach go with the PCA? Should I first standardize all the recordings (i.e., selecting only common channels, downsample the data etc.) before proceeding to performing the PCA or is...
Okay, I think I've fixed everything and have sent you the link to a fixed version. I'll include the changes in the next EP Toolkit release. It should now provide better support for .fif files and EGI Hydrocel-33 channel systems.
Great! It runs perfect! Thank you very much for all your help this weeks. I think I will finally let you rest!
No problem! It was a genuine bug, if a bit of a specialized scenario. Fixed now. The ANOVA bug seems to come up because I broke the between-group code for more than one factor when I added the support for conventional ANOVAs. I'm sending you a fix for you to try out.
All my fault, Dien! I am embarrassed to bother you uselessly. You couldn't replicate my error with good reason: After testing and testing again (because your fix didn't work) I realised the problem was with my File Preferences: I had checked the "No internal CED" checkbox. I had misunderstood the tutorial and thought that this option only applied when importing external files. Therefore, the published v.296 did not need any fix in this regard. The only question now (if you still want to hear me)...
I still can't replicate how your file runs into the triggering conditions of having no eloc info but I'm sending you a possible fix. Try it out and let me know.
Hi Dr. Dien, I'm trying to avoid the .fif import issue by first converting my files to EEGLAB .set files with Python-MNE. I can now load in data for one subject! However, I think this introduces some formatting issues that don't allow single file mode to work properly. I'll email along the files and error message.
Hi again, Thanks so much for offering to look at this. I sent along the requested items with the subject "EP Toolkit: Read epoched .fif" to your email. Please let me know if you don't see this. Thanks, Arlene
Mmmm, I think I sent you the correct files but maybe not. Anyway, I redid it now from the beginning: A new spatiotemporal PCA file (20220526_ML_rec_12av_ACPst.ept) and the error test file (resulting of running 'READ' after putting a breakpoint on line 4452 of the ep_readData file): 20220526_test.mat You can find this new two files in my sharepoint. Thanks again for your patience!
Okay, I'm starting to narrow in on what is going on with your PCA file. But there is something that still doesn't add up. The error is happening because, according to your test file, the PCA file didn't have the eloc electrode coordinates info but did have the name of the CED file and when it tried to get the info from it, it got thrown because that bit of code wasn't expecting to be doing this for a PCA file, which normally inherits the eloc information from the original average file. What is confusing...
Happy to look at it! I'll need a copy of the file, a screenshot of your settings, the output of "ver", and the startup text after you type in ep. See tutorial section on bug reports.
Hi Dr. Dien, I'm trying to read an epoched .fif file into the Toolkit, but I've run into the following error. Unrecognized function or variable 'addRefFlag'. Error in ep_readData (line 4188) if addRefFlag Error in ep>readFiles (line 13459) EPdata=ep_readData(inArg); Error in ep (line 5224) readFiles(theHandles,importFormat,dataType); Error while evaluating UIControl Callback. I've tinkered around with the settings, but keep seeing this same error. I'm happy to provide any additional info. Thanks...
Other issue (sorry!): The final v2.96 version crashs again when running robust-ANOVA with between-subject factors (the issue you had solve on may, 8th). You can find the relevant files (settings, version, test.mat file) in the sharepoint (subdirectory 20220520_rANOVA_between_fail_v296). Below you can see the error message in the command window: Commencing ANOVA run. This may take some time. You may monitor its progress by opening the html output file with a browser and periodically reloading it....