Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erp2contraipsi.m does not carry over accepted/rejected/invalid ntrials properly #197

Open
Martin2Constant opened this issue Sep 2, 2024 · 0 comments

Comments

@Martin2Constant
Copy link

Martin2Constant commented Sep 2, 2024

Description

The number of accepted/rejected/invalid trials carried over from the old ERP to the new ERP when using erp2contraipsi.m is incorrect.


  1. My ERP has 12 bins and the following number of trials.
ERP.ntrials.accepted = [24 27 41 20 18 34 30 28 34 28 36 30];
ERP.ntrials.rejected = [36 34 24 42 48 30 36 37 29 36 30 35];
ERP.ntrials.invalid = [0 0 0 0 0 0 0 0 0 0 0 0];
  1. I run pop_binoperator() with 'prepareContraIpsi' which will thus call erp2contraipsi.m.
    Original bins 1, 2, 4, 5, 7, 8, 10, 11 are used to compute 8 contra and ipsi new bins.
    Bins 3, 6, 9, 12 are not included in the formula (because they contain relevant stimuli in both hemifield).

  2. Lines 48 - 51 of erp2contraipsi.m transfer ntrials from old ERP to new ERP, but they use the index (1:nbin) instead of passing the list of relevant bins as the index.

  3. Thus, the number of trials is incorrect, because it carried over information from bins 3 and 6 (which are irrelevant for that analysis) and thus also ignored bins 10 and 11 which are relevant.

newERP.ntrials.accepted = [24, 27, 41, 20, 18, 34, 30, 28];
newERP.ntrials.rejected = [36, 34, 24, 42, 48, 30, 36, 37];
newERP.ntrials.invalid = [0, 0, 0, 0, 0, 0, 0, 0];
  1. I believe the fix could be:
    a. Carrying over the list of relevant bins (let's call it relbins)
    b. On line 48, replacing: ERP.ntrials.accepted(1:ERPout.nbin) with ERP.ntrials.accepted(relbins) (same fix for the next 3 lines).

#### Versions
OS version Windows 10 22H2
Matlab version 2024a
EEGLAB version 2024.0
ERPLAB version 12.00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant