Skip to main content
Social Sci LibreTexts

1.1: Getting Started

  • Page ID
    135674
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    This section of Chapter 1 provides some important background information that you need to know to make effective use of this book. The whole book will make much more sense if you read this section first!

    The Goal of This Book

    The primary goal of this book is to help students and researchers learn how to process and analyze event-related potentials (ERPs). My other ERP book (Luck, 2014) focuses on providing a conceptual understanding of ERPs, and the present book focuses on applying those concepts to real data. Theory is important, but there is no substitute for loading up real data—with all its warts and complexities—and figuring out how to go from a gigabyte of raw EEG files to a set of statistical analyses and figures that are ready for publication.

    At its essence, this book is a set of data processing and analysis exercises that are wrapped in explanatory text. ERP analysis involves a million decisions, such as whether to filter before versus after artifact rejection and what measurement window to use for quantifying the amplitude of an ERP component. The exercises in this book are designed to give you experience making choices that will lead to the most robust and valid conclusions. In theory, you could read the book without doing the exercises, but that would be like trying to learn painting from a textbook without ever picking up a paintbrush. So fire up your computer and get ready to process some data!

    I waited until now to write this book because I needed two things: 1) Free software that anyone can use to do the exercises, and 2) a large public dataset with multiple different ERP paradigms. Both are now available. The free software consists of ERPLAB Toolbox and its companion EEGLAB Toolbox, and the large public dataset is the ERP CORE (Compendium of Open Resources and Experiments).

    ERPLAB and EEGLAB

    ERPLAB (Lopez-Calderon & Luck, 2014) is a Matlab toolbox that my lab produces with a grant from the National Institutes of Health (NIH). ERPLAB works in tandem with another NIH-supported Matlab toolbox called EEGLAB, which is developed under the leadership of Arno Delorme and Scott Makeig at UCSD (Delorme & Makeig, 2004). EEGLAB takes care of several important EEG preprocessing steps, and ERPLAB allows you to create and analyze averaged ERP waveforms. The good news is that both of these toolboxes are free. The bad news is that Matlab is not free, and you will need it to run EEGLAB and ERPLAB. However, most institutions provide reduced-cost Matlab licenses, and the student version is even less expensive. Matlab has become the lingua franca of cognitive neuroscience, and it’s well worth the investment.

    The ERP Core

    The ERP CORE is a set of six classic ERP paradigms that have been optimized to isolate seven widely-studied ERP components (N170, mismatch negativity, N400, P3b, N2pc, error-related negativity, and lateralized readiness potential). Emily Kappenman and I created the ERP CORE to provide a set of “reference” data that could be used by a large set of researchers for a wide range of purposes. The public resource includes the experimental control scripts, data from 40 neurotypical young adults, and the EEGLAB/ERPLAB processing scripts. If you’d like to know how to obtain a robust N400, you can download our N400 experimental control script to see how it’s done. If you’d like to see how to professionally analyze the error-related negativity (ERN), you can download our ERN processing scripts. If you’ve just put together your own EEG recording system and you’d like to see if everything is working, you can run or more of our paradigms and compare your data with our data (including quantitative metrics of data quality).

    The ERP CORE is particularly useful for this book because it provides data from many different paradigms, and yet the data are similarly formatted for each paradigm. That way you can see how to process many different types of data, but you won’t have to deal with superficial differences between data sets (e.g., differences in file naming conventions). Although you can download the ERP CORE files directly from the ERP CORE site, you should instead download the data using the links provided within this book for each exercise, which provide a more streamlined set of files.

    Scripting

    EEGLAB has a graphical user interface (GUI) that allows you to process data by pointing and clicking, and ERPLAB works as a plugin to EEGLAB. Many people use EEGLAB and ERPLAB entirely through the GUI. With the exception of the last chapter, all the exercises in this book use the GUI.

    However, you can achieve a lot of additional power and flexibility by writing Matlab scripts, which are text files that specify each processing operation with a line of code. Scripts allow you to automate the EEG and ERP processing steps, which is a huge time-saver (especially when your mentor or a reviewer makes you reprocess all of your data). If you already know how to write Matlab scripts, then you’ll find it straightforward to write scripts with the EEGLAB and ERPLAB routines. If you don’t know Matlab but you have some significant experience in one or more other programming languages, you’ll be able to pick up Matlab pretty quickly (although it has a few quirks that you’ll need to learn).

    If you don’t have much programming experience, EEGLAB and ERPLAB provide a good starting point for you to learn. Every operation that you perform in the EEGLAB/ERPLAB GUI corresponds to a line of code, and every time you perform an EEGLAB or ERPLAB operation in the GUI, that line of code is saved to a history. You can grab these lines of code from the history, paste them into a text file, and voila! You have a script!

    To get real power and flexibility, however, you also need to learn a little bit about the Matlab programming language. Chapter 11 is devoted to teaching you how to write EEGLAB/ERPLAB scripts. It’s designed for people at all levels of prior programming experience. However, it does assume that you know some basic programming concepts (e.g., variables, loops). If you want to learn scripting—which is an incredibly useful skill—I recommend taking a Matlab course and/or working through one or more Matlab books. I particularly recommend a book called Matlab for Behavioral Scientists (Rosenbaum et al., 2014) and the online Introduction to Programming with MATLAB course from Coursera.

    I’ve also provided example scripts at the end of each chapter, showing you how to implement the GUI steps from that chapter in a script. I find that it’s much easier to start with an example script and modify it than to write a script from scratch.

    Although the chapter on scripting is the last chapter of the book, you might want to read the first half sooner than that so that you understand the essence of EEGLAB/ERPLAB scripting. The last half of Chapter 11 uses processing steps that are covered in Chapters 2-10, so you should probably save that half until later.

    Expected Background Knowledge

    This book assumes that you already have some very basic knowledge about ERPs. If you don’t, Appendix 1 provides a quick overview. Here are some things you’ll need to know right away:

    Generation of the EEG from postsynaptic potentials in cortical pyramidal cells

    All of these issues are briefly covered in Appendix 1, and you should read about them if they are not already familiar.

    If you want additional background, I recommend the first 2 chapters in An Introduction to the ERP Technique (Luck, 2014) or a chapter I wrote for the APA Handbook of Research Methods (Luck, 2012). Or, better yet, you can take my free online course, Introduction to ERPs, which typically takes about 4 hours to complete. The first 2 “chapters” of the online course would be enough to get you started and should take you less than an hour.

    Much of the theory behind the analysis approaches described in this book is described in An Introduction to the ERP Technique (Luck, 2014). If you want to become an ERP researcher, you need to understand the reasons behind the recommended processing steps, so I recommend going back and forth between that book and the present book. You’ll see lots of places in the present book where I point you to the relevant chapters in An Introduction to the ERP Technique.

    You will also want to consult the online documentation for EEGLAB and ERPLAB if you want to understand some of the options and parameters in the software. There are millions of details about the operation of the software that I didn’t want to repeat in this book.

    Read This Now or You'll Be Sorry!

    The original heading for this section was “Troubleshooting,” but that sounds way too boring, and I figured many people would skip it. But don’t skip it! This is the most important section of this chapter.

    Unless you already have years of experience with EEGLAB and ERPLAB, you’re bound to run into a few problems when you try to complete the exercises in this book. EEGLAB and ERPLAB are professional-strength software packages designed for state-of-the-art research, and the datasets used in the exercises are large and complex. As a result, I can’t foresee every possible problem that might arise on your individual computer, and you’ll probably encounter error messages, results that don’t match what are shown in the book, etc.

    When you encounter one of these problems, you’ll certainly be frustrated and you might even be tempted to curse my ancestors. But these problems are actually an important part of the learning process. When you’re analyzing your own data, you’ll run into many of the same problems. In fact, the problems will probably be worse with your own data, because the data used in our exercises have been carefully chosen to avoid many common problems.

    So, when you run into a problem, try to look at it as an opportunity for growth. Of course, you might let out a few expletives and need to spend a minute doing deep breathing exercises before you remember that the error message on the screen is actually a gift in disguise. To reduce your blood pressure and help you learn the art of troubleshooting, we’ve provided a Troubleshooting Guide in Appendix 2. I recommend skimming it now and then returning to it when you inevitably run into problems.

    Here's a related but more positive piece of advice: Play! I learned the important of playing in science from one of my undergrad mentors, Allen Neuringer. If you simply follow the exercises in this book exactly as written, you’ll certainly learn a lot. But if you want to really understand what you’re doing, you should spend considerable time playing around with things (e.g., the various options in the ERPLAB GUI). For example, there are many things that I say you shouldn’t do, such as applying a high-pass filter to averaged ERP waveforms. But don’t just take my word for it – try it and see what happens.


    This page titled 1.1: Getting Started is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Steven J Luck directly on the LibreTexts platform.

    • Was this article helpful?