Commit b34e7a8b authored by Andero Uusberg's avatar Andero Uusberg

commented the R file

parent 2a7a249b
......@@ -172,9 +172,9 @@ colnames(d)
## DATA REDUCTION IN EEG
Here's what I expoerted in terms of ERPs. To keep things simple, I only included one elextrode and sampled the time in increments that correspond to clearly visible peaks (P2 and P3) and the just increasingly longer increments within LPP.
Here's how I expoerted the ERPs. To keep things simple, I only included one electrode and sampled the time in increments that first correspond to clearly visible peaks (P2 and P3) and then become just increasingly longer increments within LPP (because the effects we can discern from ERPs also become more distributed in time).
% EXPORT ERP (see help exportERPeffect)
% ERP
exportERPeffect([epochdir date '-export.xlsx'], p,{1:2,1:2,1:4},...
{'P2', {'Pz'}, [150 250];...
'P3', {'Pz'}, [250 500];...
......@@ -185,12 +185,12 @@ Here's what I expoerted in terms of ERPs. To keep things simple, I only included
We may not be happy with this for two reasons
- it probably makes sense to average over a few more electrodes, as this improves signal to noise ratio.
- it probably makes sense to average over a few more electrodes to improves the SNR.
- the windoes selection beyond P3 is pretty arbitraty, so we can make this both more or less dense.
- the windows selection beyond P3 is pretty arbitraty, so we can make this both more or less dense.
I also did a first sweep of ERSP - event-related spectral perturbations - analysis. I looked at the emotion main effect to select the regions for each frequency. I selected just some broad time windoes, since the effects were pretty widely distributed. But all of this can be done more intelligently as well.
I also did a first sweep of ERSP - event-related spectral perturbations - analysis. I looked at the emotion main effect to select the regions of interest for each frequency. I selected just some broad time windoes, since the effects were pretty widely distributed. All of this can probably be done more intelligently as well.
% Delta effect
exportERPeffect([epochdir date '-delta.xlsx'], p.delta,{1:2,1:2,1:4},...
......@@ -213,35 +213,36 @@ I also did a first sweep of ERSP - event-related spectral perturbations - analys
'alpha3', {'Pz' 'P3' 'P4'}, [1000 1500];...
'alpha4', {'Pz' 'P3' 'P4'}, [1500 2000]}, [-200 0]);
## SHAPE OF DATA HERE
## SHAPE OF THE DATA HERE
The preprocessing produces three files - d (the original data imported from disk), erp (data reshaped for ERP analysis) and ersp (data reshaped for ERSP analysis). d has one row per trial, erp and ersp have one row per EEG window x picture.
The preprocessing produces three files - d (the original data imported from disk), erp (data reshaped for ERP analysis) and ersp (data reshaped for ERSP analysis). d has one row per trial, erp and ersp have one row per each EEG window and picture (so first and second presentation are in the same row).
erp ja ersp have the same basic structure:
"Subject"
"photo" - each row has stuff from both the individual and social phases concerning a single picture
"photo" - each row has stuff from both the individual and social phase presentations of the same picture
"window" - time window (see the EEG export codes above)
"order.indiv" - order of this rows' picture in the individual phase
"order.social"
"rate.indiv" - rating of this rows' picture in the individual phase
"rate.indiv" - rating of the picture in the individual phase
"rate.social"
"rt.indiv" - response time to this rows' picture in the individual pahse
"rt.indiv" - response time for this picture in the individual pahse
"rt.social"
"erp.indiv" - ERP measured in response to the picture in the individual phase
"erp.social"
"erp.indiv"/"ersp.indiv" - ERP measured in response to the picture in the individual phase
"erp.social"/"ersp.indiv"
"grate" - group rating
"condition" - experimental condition
"rate.predict" - predicted rating for the second phase (with the aim to account for adaptation) computed as intercept + weight*first phase rating
"intercept" - individual-specific intercept from a mixed model predicting second pahse ratings from first phase rating in the none condition
"intercept" - individual-specific intercept from a mixed model predicting second phase rating from first phase rating in the "none" condition
"weight" - individual-specific slope from the same model
"mismatch" - difference between group rating and actual ratings from the individual phase
"mismatch2" - alternative version of the same idea: difference between group rating and "adaptation-corrected rating" (rate.predict variable above)
"magnitude" - to isolate the size of the discrepancy from it's sign: absolute value of the mismatch
"magnitude" - to isolate the size of the mismatch from it's sign: absolute value of the mismatch
"magnitude2" - absolute value of mismatch2
"direction" - to isolate the sign of the mismatch from its size: -1 (mismacth<0), 0(mismatch==0), 1(mismatch>0)
"direction2" - altrernative version defined from the quantiles of mismatch2: -1 (below 1/3 quantile); 0; (from 1/3 to 2/3 quantile); 1 (above 2/3 quantile)
"direction2" - altrernative version defined from the quantiles of mismatch2: -1 (below 1/3); 0; (from 1/3 to 2/3); 1 (above 2/3)
"rate.dif" - residualized difference between first and second phase ratings (residualizing makes sure that the variance comes from the second phase)
"erp.dif"/"ersp.dif" - the same thing for the DV
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment