Key Takeaways
-
The process of creating a script typically involves running the processing steps in the EEGLAB/ERPLAB GUI, copying the commands from the history into a script, and adding a loop.
-
You will save yourself a lot of time and pain in the long run by using intrinsically meaningful variable names, including lots of comments, and defining all key values as variables at the top of the script.
-
It’s almost always better to write a sequence of relatively simple scripts rather than one large script that does everything. This makes errors less likely, makes errors easier to find, and gives you more flexibility.
-
You should make extensive use of the GUI the first time your process the data from a given participant. This allows you to detect problems in the data, set participant-specific parameters (e.g., for artifact rejection and correction), and make sure that everything is working properly. Once you’ve gone through the data in this manner, you should reprocess the data with your scripts (which helps avoids errors that can occur in manual processing).
-
You can learn a lot by getting example scripts from other people, but don’t apply those scripts to your own data unless you fully understand every line of code.
References
Emerson, R. W. (1841).
Self-Reliance
. Lulu Press.
Luck, S. J., Stewart, A. X., Simmons, A. M., & Rhemtulla, M. (2021). Standardized measurement error: A universal metric of data quality for averaged event-related potentials.
Psychophysiology
,
58
, e13793.
https://doi.org/10.1111/psyp.13793
Rosenbaum, D. A., Vaughan, J., & Wyble, B. (2014).
MATLAB for Behavioral Scientists
(2nd Edition). Routledge.
Rossion, B., & Caharel, S. (2011). ERP evidence for the speed of face categorization in the human brain: Disentangling the contribution of low-level visual cues from face perception.
Vision Research
,
51
(12), 1297–1311.
https://doi.org/10.1016/j.visres.2011.04.003