DATA! NOW WHAT? Preparing your ERP data for analysis Dennis L. Molfese, Ph.D. Caitlin M. Hudac, B.A. Developmental Brain Lab University of Nebraska-Lincoln 1
Agenda Pre-processing Preparing for analysis steps 2
EEG to ERP 3
EEG to ERP 4
EEG to ERP 5
Pre-processing in NetStation 6
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 7
Filtering Filtering reduces total frequencies by specific amounts 8
Filtering 60 cycle : Without proper grounding, impedance between electrode and amplifier can become very large. Causes: skin-to-skin contact, high-frequency interference from nearby electrical devices. Adjust using a notch filter 9
FILTERS CHANGE YOUR DATA! 10
FILTERS CHANGE YOUR DATA! 11
FILTERS CHANGE YOUR DATA! 12
FILTERS CHANGE YOUR DATA! 13
Filtering Keep in mind: Filters are additive -- the data changes each time you filter. Use same filter settings (and amplifiers) for one dataset. Try different filters out. 14
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 15
Segmentation Raw EEG signal stamped with stimulus event markers. Segments are the length we want to choose for our ERP. Can be different for each kind of stimulus. 16
Segmentation Event markers: Codes are linked to objects in EPrime. 17
Segmentation 18
Segmentation Offsets: Actual display of object will depend on the connection between PC (EPrime) and Mac (NetStation) computers. PC sends stimulus Stimulus Offset Offset Time Stimulus presented NetStation marks EEG ba 6 da 4 ga 4 bu 5 du 7 gu 6 19
Segmentation 20
Segmentation Visual Inspection Eye channels could be poor due to no contact with skin or blinks/eye movements. If poor across high number of trials, electrode must be marked BAD for entire recording. 21
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 22
Artifact Strategy First: Artifact Detection Inspect Eye Channels Check impedance levels from records Have Artifact Detection check for you. Second: Artifact Rejection Replace bad channels through spherical interpolation 23
Artifact Detection What electrodes have bad or noisy signal? Bad channels Eye blinks Eye movements Define artifacts by threshold. Ex: Max-Min = 200µV is bad channel over segment. Define artifacts by slope of line -- how quickly does the signal change? Define artifacts by modeling examples. 24
Artifact Detection Bad Channel Scan - shorted electrodes - bad scalp connection - 200 µv over segment Eye Blinks & Movement -electrode pairs -differ by net type 25
Artifact Detection Eye Movements: 125 & 128 Eye Blinks: 8-126, 26-127 26
Artifact Detection Be careful: The algorithms can be too simple. If eye channels detect an eye movement or blink, NetStation may mark the segment bad. If an eye channel is bad, may mark all segments bad. 27
Artifact Detection 28
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 29
Artifact Regression Spherical interpolation 30
Artifact Regression NetStation uses an automatic ICA Automatically removes eye movement and blink artifacts using blind component separation. Prior to artifact regression with ocular artifacts without ocular artifacts After artifact regression (Joyce, Gorodnitsky, & Kutas, 2004) 31
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 32
Baseline Correction Important to avoid artifacts in baseline period! Adjust pre-stimulus value (e.g. 100-200 ms) by averaging across pre-stimulus points during baseline. Subtract average value from post-stimulus period. 33
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 34
Bad Channel Correction No user settings. Instead, we interpolate missing channels using weighted average. 35
ERP Pre-processing Fix high/low frequencies Need to chop up EEG into ERP Fix blinks, muscle movements, etc. ERP signal level may vary for each segment Channels with poor signal (e.g impedance, bad electrode) Re-reference; combine trials Filter Segmentation Artifact detection Artifact rejection Baseline correction Bad channel correction Averaging 36
Average Reference Why re-reference? Data originally recorded to represent the difference between an electrode and reference (Cz). Define a new zero point. Using an average reference reduces the bias of a particular reference. 37
Average Reference 38
Averaging trials Averaging is a noise reduction technique. Combine trials to form a single averaged waveform. What trials to average? same condition (happy faces) all stimulus of one type (happy, angry, and fearful faces) 39
Averaging Important Strategies to keep in mind: Equal Number of Averages / Condition Equal Number of Averages / Subject Weighted Averaging Random Selection of Trials Early vs. Late in Experiment 40
Automating analyses Build scripts for each study. Easy -- just drag and drop! 41
Controversy of Order Does the order of operation change the data? Baseline Correction Re-referencing the data Averaging segments 42
Controversy of Order 1. Average 2. Average reference 3. Baseline correction 1. Average reference Average 2. Baseline correction 1. Baseline correction Average 2. Average reference 43
Pre-processed data: Now what? Perform NetStation analyses Peak amplitude /latency Export data to work in statistical package of choice (e.g. SPSS, SAS, MATLAB). Rotate the data? Combine regional electrodes? 44
Exporting data Use NetStation exporter (AVG --> RAW) then convert using Text Exporter program (RAW --> TXT) Use File Export tool in Netstation 45
Exporting data BE CAREFUL ABOUT FILE NAMING! One text file per person per condition 00001_6x25.ave_ba.txt 00001_6x25.ave_da.txt 00001_6x25.ave_ga.txt 00001_6x25.ave_bu.txt 00001_6x25.ave_du.txt 00001_6x25.ave_gu.txt 00001_6x25.ave.RAW 00002_6x25.ave_ba.txt 00002_6x25.ave_da.txt 00002_6x25.ave_ga.txt 00002_6x25.ave_bu.txt 00002_6x25.ave_du.txt 00002_6x25.ave_gu.txt 00002_6x25.ave.RAW 46
MCAT Program 1. Rotate data matrix for input to stat programs. 2. Concatenate subject data text files. 3. Combine electrode sites into regional electrodes. 47
MCAT Program 1. Rotate data matrix for input to stat programs. 2. Concatenate subject data text files. 3. Combine electrode sites into regional electrodes. BEFORE AFTER Channel 1 Data Pt 1 Channel 2 Data Pt 1 Channel 3 Data Pt 1 Channel 1 Data Pt 1 Channel 2 Data Pt 1 Channel 3 Data Pt 1 Channel 1 Data Pt 2 Channel 2 Data Pt 2 Channel 3 Data Pt 2 Channel 1 Data Pt 2 Channel 2 Data Pt 2 Channel 3 Data Pt 2 Channel 1 Data Pt 3 Channel 2 Data Pt 3 Channel 3 Data Pt 3 Channel 1 Data Pt 3 Channel 2 Data Pt 3 Channel 3 Data Pt 3 Suitable for Spatial PCA Suitable for Temporal PCA 48
MCAT Program 1. Rotate data matrix for input to stat programs. 2. Concatenate subject data text files. 3. Combine electrode sites into regional electrodes. 00001_6x25.ave_ba.txt 00001_6x25.ave_da.txt 00001_6x25.ave_ga.txt 00001_6x25.ave_bu.txt 00001_6x25.ave_du.txt 00001_6x25.ave_ba.txt + 00001_6x25.ave_da.txt + 00001_6x25.ave_ga.txt + 00001_6x25.ave_bu.txt + 00001_6x25.ave_du.txt + 00001_6x25.ave_gu.txt 00001_6x25.ave_gu.txt 00001_6x25.ave.RAW 00001_6x25.ave.RAW 49
MCAT Program 1. Rotate data matrix for input to stat programs. 2. Concatenate HydroCel subject Geodesic data text Sensor files. Net 256 Channel Map Version 1.0 3. Combine electrode sites into regional electrodes. 243 242 241 31 238 239 240 244 32 25 234 245 235 37 18 33 19 246 26 236 Fp1 Fp2 248 46 10 38 11 230 27 20 247 34 12 237 249 47 2 231 54 F7 21 F8 1 252 39 28 13 3 226 250 35 4 232 22 14 253 48 29 5 222 55 40 223 221 225 15 251 254 61 36 224 Fz 220 227 233 23 6 41 214 67 49 30 215 56 F3 F4 213 255 16 7 212 219 228 62 42 24 207 206 211 73 50 8 205 218 256 68 57 43 17 198 197 204 210 229 63 51 196 203 58 9 186 44 185 195 69 59 202 82 64 52 184 REF 183 194 T3 C3 T4 217 CZ C4 65 45 132 70 53 144 182 193 60 81 155 91 71 66 164 72 80 131 181 74 173 216 79 90 143 192 75 78 154 180 92 76 77 89 130 163 172 209 83 COM 88 142 191 84 86 87 101 153 162 93 85 100 129 179 94 P3 P4 171 201 Pz 190 LM 99 141 RM 102 95 98 110 T5 96 97 119 128 152 178 208 161 170 T6 103 109 140 200 104 118 127 108 151 189 105 106 107 160 117 139 169 177 111 126 199 116 150 112 113 114 115 125 138 159 188 168 176 124 149 O1 137 O2 123 Oz 158 120 121 122 167 175 187 136 148 135 134 147 133 146 156 145 S/N 157 165 166 174 For questions or additional assistance please refer to the EGI Sensor Net Technical Manual or contact us at: 256 Hydrocel Net Electrical Geodesics, Inc. 1600 Millrace Drive, Suite 307 Eugene, Oregon 97403 Phone: (541) 687-7962 Fax:(541) 687-7963 Email: support@egi.com or info@egi.com 50
MCAT Program 1. Rotate data matrix for input to stat programs. 2. Concatenate subject data text files. 3. Combine electrode sites into regional electrodes. 243 242 241 31 238 239 240 244 32 25 234 245 235 37 18 33 19 246 26 236 Fp1 Fp2 248 46 10 38 11 230 27 20 247 34 12 237 249 47 2 231 54 F7 21 3 F8 1 252 39 28 13 226 250 35 4 232 22 14 253 48 29 5 222 55 40 223 221 225 15 251 254 61 36 224 23 Fz 220 227 233 6 41 214 67 49 F3 30 215 56 F4 213 255 16 7 212 219 228 62 42 24 207 206 211 73 50 8 205 218 256 68 57 43 17 198 197 204 210 229 63 51 196 203 58 44 9 186 185 195 69 59 52 202 82 64 184 REF 183 194 T3 C3 T4 217 CZ C4 65 45 132 70 53 144 182 193 60 81 155 91 71 66 164 74 72 80 131 181 173 216 79 90 143 192 75 78 154 180 92 76 77 89 130 163 172 209 83 COM 88 142 191 84 86 93 87 101 153 162 94 85 100 129 179 P3 P4 171 201 Pz 190 LM 99 141 RM 102 95 98 110 T5 96 97 119 128 152 178 208 161 103 170 T6 109 140 200 104 118 127 108 151 189 105 106 107 160 117 139 169 177 111 126 199 116 150 112 113 114 115 125 138 159 188 168 176 124 149 O1 137 O2 123 Oz 158 120 121 122 167 175 187 136 148 133 134 145 135 146 147 S/N 156 157 165 166 174 256 Hydrocel Net 51
MCAT Program For Temporal PCA analyses, drag n drop text files.! 52
MCAT Program Subject 00001 Time points for ba! 53
Summary Pre-processing involves making informed decisions about your data! Review the literature for similar paradigms to decide how to start. Make a plan -- be prepared and organized. It s okay to revise your plan! 54
QUESTIONS??? dlmolfese@mac.com caitlin.hudac@huskers.unl.edu pmolfese@mac.com 55
MCAT 56
MCAT to SPSS 57