Free Recall Analysis

Utilities for working with free recall data.

psifr.fr.block_index(list_labels)

Get index of each block in a list.

psifr.fr.check_data(df)

Run checks on free recall data.

Parameters

df (pandas.DataFrame) –

Contains one row for each trial (study and recall). Must have fields:
subjectnumber or str

Subject identifier.

listnumber

List identifier. This applies to both study and recall trials.

trial_typestr

Type of trial; may be ‘study’ or ‘recall’.

positionnumber

Position within the study list or recall sequence.

itemstr

Item that was either presented or recalled on this trial.

psifr.fr.get_recall_index(df, list_cols=None)

Get recall input position index by list.

psifr.fr.get_study_value(df, column, list_cols=None)

Get study column value by list.

psifr.fr.lag_crp(df, test_values=None, test=None, first_output=None)

Lag-CRP for multiple subjects.

Parameters
  • df (pandas.DataFrame) – Merged study and recall data. See merge_lists. List length is assumed to be the same for all lists within each subject. Must have fields: subject, list, input, output, recalled. Input position must be defined such that the first serial position is 1, not 0.

  • test_values (pandas.Series or column name, optional) – Column with labels to use when testing transitions for inclusion.

  • test (callable, optional) – Callable that takes in previous and current item values and returns True for transitions that should be included.

  • first_output (int, optional) – First output position to include when calculating transition probabilities. Used to exclude initial outputs. Default is to start at the first recall on each list.

Returns

results – Has fields:

subjecthashable

Results are separated by each subject.

lagint

Lag of input position between two adjacent recalls.

probfloat

Probability of each lag transition.

actualint

Total of actual made transitions at each lag.

possibleint

Total of times each lag was possible, given the prior input position and the remaining items to be recalled.

Return type

pandas.DataFrame

psifr.fr.merge_lists(study, recall, merge_keys=None, list_keys=None, study_keys=None, recall_keys=None, position_key='position')

Merge study and recall events together for each list.

Parameters
  • study (pandas.DataFrame) – Information about all study events. Should have one row for each study event.

  • recall (pandas.DataFrame) – Information about all recall events. Should have one row for each recall attempt.

  • merge_keys (list, optional) – Columns to use to designate events to merge. Default is [‘subject’, ‘list’, ‘item’], which will merge events related to the same item, but only within list.

  • list_keys (list, optional) – Columns that apply to both study and recall events.

  • study_keys (list, optional) – Columns that only apply to study events.

  • recall_keys (list, optional) – Columns that only apply to recall events.

  • position_key (str, optional) – Column indicating the position of each item in either the study list or the recall sequence.

Returns

merged – Merged information about study and recall events. Each row corresponds to one unique input/output pair.

The following columns will be added:

inputint

Position of each item in the input list (i.e., serial position).

outputint

Position of each item in the recall sequence.

recalledbool

True for rows with an associated recall event.

repeatint

Number of times this recall event has been repeated (0 for the first recall of an item).

intrusionbool

True for recalls that do not correspond to any study event.

Return type

pandas.DataFrame