Auerbach-Lab/Behavior-autoanalysis

Training Oddball Getting wrong stats

Closed this issue · 0 comments

Issue

False alarm miss-calculated in the database "Calculated Summary Statistics" but not during "Validate Mat Summary" due being Training - Oddball.

FA% in "Calculated Summary Statistics" = FAs / trial_count
FA% in "Validate Mat Summary" = FAs / trial_count_nogo

Expected Behavior

For Training - Oddball, the calculated false alarm rate should be stats should match in both the "Validate Mat Summary" and in Calculated Summary Statistics

Fix

if (str_detect(analysis$type, pattern = "Oddball")) FA_percent = FAs / trial_count

Change to if (str_detect(analysis$type, pattern = "$Oddball"))
All other Oddball IDs start with Oddball; only Training - Oddball does not. Thus by doing a check only for Oddball at the start of the ID we prevent it from triggering for Training - Oddball.

Notes

For all other Oddball files, we need to calculate it differently (because its out of the total number of trials. (❗ Note: this may not be true when there is catch trials, but that is a different issue.)