-
Notifications
You must be signed in to change notification settings - Fork 2
2.3.17 getGroupedTrialStats()
Shun Li edited this page Jan 2, 2024
·
3 revisions
Get trial statistics for a given range of inputs. Made compatible with plotGroupedTrialStats().
Required inputs
-
animals: struct, can be eitheranimalsstruct (not tested onsummarystruct but might work) -
statsTypes: Name of the variable to extract- Can either be a list or a char/string. If it's a list, then it has to have the same number of elements as the task (
taskRange).
- Can either be a list or a char/string. If it's a list, then it has to have the same number of elements as the task (
Options
-
concatSessions: double, default is true. Concatenate all sessions. Will separate sessions if equals to false. -
eventRange: string, default is 'All', else you can enter something like{'Stim','Pair'} -
animalRange: string, default is 'All', else you can enter something like{'SL133','SL135'} -
taskRange: string, default is 'All', else you can enter something like{'Reward1','Reward2'} -
sessionRange: string, default is 'All', else you can enter something like{'R1','R2'}to select session with contains 'R1/R2' -
signalRange: string, default is 'All', else you can enter something like{'NAc','LHb'} -
totalTrialRange: string, default is 'All', else you can enter something like[1,60]. See Details section incombineTraces()for relationship betweentotalTrialRangeandtrialRange. -
trialRange: string, default is 'All', else you can enter something like[1,20] -
inTrialTable: logical, no default value. When running the function, it will automatically determine whether the statistics of interest is stored in trial table or not.
-
combinedStats: struct, have two fields as following:-
stats: stores the statistics of interest. -
options: options used. The most important one isinTrialTable, which will be used inplotGroupedTrialStats().
-
stats = getGroupedTrialStats(animals,'stageAvg',...
eventRange=eventRange,...
animalRange=animalRange,...
taskRange=taskRange,...
totalTrialRange=[1,150],...
signalRange=signalRange,...
concatSessions=false);
This will generate combinedStats structure with following contents:
combinedStats.stats
Each cell here indicates a specific task (e.g. 'Reward pairing', 'Punish pairing').

combinedStats.stats{1}
Each row here indicates an animal, each column indicates a event type for that animal (e.g. 'Stim','Pair').

combinedStats.stats{1}{1,1}
Each row indicates a trial, each column indicates a specific stage if applicable. For variables in trial table, this will only have one column.

combinedStats.options
