Recall performance#
First, load some sample data and create a merged DataFrame:
In [1]: from psifr import fr
In [2]: df = fr.sample_data('Morton2013')
In [3]: data = fr.merge_free_recall(df)
Raster plot#
Raster plots can give you a quick overview of a whole dataset [RKT16].
We’ll look at all of the first subject’s recalls using plot_raster()
.
This will plot every individual recall, colored by the serial position of the
recalled item in the list. Items near
the end of the list are shown in yellow, and items near the beginning of the
list are shown in purple. Intrusions of items not on the list are shown in red.
In [4]: subj = fr.filter_data(data, 1)
In [5]: g = fr.plot_raster(subj).add_legend()
Serial position curve#
We can calculate average recall for each serial position [Mur62]
using spc()
and plot using plot_spc()
.
In [6]: recall = fr.spc(data)
In [7]: g = fr.plot_spc(recall)
Using the same plotting function, we can plot the curve for each individual subject:
In [8]: g = fr.plot_spc(recall, col='subject', col_wrap=5)
Probability of Nth recall#
We can also split up recalls, to test for example how likely participants
were to initiate recall with the last item on the list, using pnr()
.
In [9]: prob = fr.pnr(data)
In [10]: prob
Out[10]:
prob actual possible
subject output input
1 1 1 0.000000 0 48
2 0.020833 1 48
3 0.000000 0 48
4 0.000000 0 48
5 0.000000 0 48
... ... ... ...
47 24 20 NaN 0 0
21 NaN 0 0
22 NaN 0 0
23 NaN 0 0
24 NaN 0 0
[23040 rows x 3 columns]
This gives us the probability of recall by output position ('output'
)
and serial or input position ('input'
). This is a lot to look at all
at once, so it may be useful to plot just the first three output positions.
We can plot the curves using plot_spc()
, which takes an
optional hue
input to specify a variable to use to split the data
into curves of different colors.
In [11]: pfr = prob.query('output <= 3')
In [12]: g = fr.plot_spc(pfr, hue='output').add_legend()
This plot shows what items tend to be recalled early in the recall sequence.
Prior-list intrusions#
Participants will sometimes accidentally recall items from prior lists;
these recalls are known as prior-list intrusions (PLIs). To better understand
how prior-list intrusions are happening, you can look at how many lists back
those items were originally presented using pli_list_lag()
.
First, you need to choose a maximum list lag that you will consider. This determines which lists will be included in the analysis. For example, if you have a maximum lag of 3, then the first 3 lists will be excluded from the analysis. This ensures that each included list can potentially have intrusions of each possible list lag.
In [13]: pli = fr.pli_list_lag(data, max_lag=3)
In [14]: pli
Out[14]:
count per_list prob
subject list_lag
1 1 7 0.155556 0.259259
2 5 0.111111 0.185185
3 0 0.000000 0.000000
2 1 9 0.200000 0.191489
2 2 0.044444 0.042553
... ... ... ...
46 2 1 0.022222 0.100000
3 0 0.000000 0.000000
47 1 5 0.111111 0.277778
2 1 0.022222 0.055556
3 0 0.000000 0.000000
[120 rows x 3 columns]
In [15]: pli.groupby('list_lag').agg(['mean', 'sem'])
Out[15]:
count per_list prob
mean sem mean sem mean sem
list_lag
1 5.55 0.547664 0.123333 0.012170 0.210631 0.014726
2 1.35 0.230801 0.030000 0.005129 0.043458 0.007032
3 0.75 0.174496 0.016667 0.003878 0.023385 0.005602
The analysis returns a raw count of intrusions at each lag (count
),
the count divided by the number of included lists (per_list
), and the
probability of a given intrusion coming from a given lag (prob
). In
the sample dataset, recently presented items (i.e., with lower list lag) are
more likely to be intruded.