This function calculates the probability of first recall for each serial position. The total number of times an item was recalled first is divided by the total number of first recalls (i.e., the number of participants who wrote anything down!).

pfr(data, position, answer, id, key, scored, group.by = NULL)

Arguments

data

a dataframe of the scored free recall that you would like to calculate - use prop_correct_free() for best formatting.

position

a column name in the dataframe that contains answered position of each response in quotes (i.e., "column")

answer

a column name of the answer given for that position in the original dataframe.

id

a column name of the participant id in the original dataframe.

key

a vector containing the scoring key or data column name. This column does not have to be included in the original dataframe. We assume your answer key is in the tested position order. You should not include duplicates in your answer key.

scored

a column in the original dataframe indicating if the participant got the answer correct (1) or incorrect (0).

group.by

an optional argument that can be used to group the output by condition columns. These columns should be in the original dataframe and concatenated c() if there are multiple columns

Value

DF_PFR

A dataframe of the probability of first response for each position including group by variables if indicated.

Details

This output can then be used to create a PFR visualizations, and an example can be found in our manuscript/vignettes.

Important: The code is written assuming the data provided are for a single recall list. If repeated measures are used (i.e., there are multiple lists completed by each participant or multiple list versions), you should use this function several times, once on each list/answer key.

Examples


data(free_data)
data(answer_key_free2)

free_data <- subset(free_data,
 List_Type == "Cat_Recall_L1")

DF_long <- arrange_data(data = free_data,
 responses = "Response",
 sep = " ",
 id = "Username")

scored_output <- prop_correct_free(data = DF_long,
 responses = "response",
 key = answer_key_free2$Answer_Key,
 id = "Sub.ID",
 cutoff = 1,
 flag = TRUE,
 group.by = "Version")

pfr_output <- pfr(data = scored_output$DF_Scored,
 position = "position",
 answer = "Answer",
 id = "Sub.ID",
 key = answer_key_free2$Answer_Key,
 scored = "Scored",
 group.by = "Version")

 head(pfr_output)
#>   Tested.Position Version Freq  pfr
#> 1               1       A    2 0.10
#> 2               2       A    1 0.05
#> 3               3       A    0 0.00
#> 4               5       A    1 0.05
#> 5               6       A    0 0.00
#> 6               7       A    1 0.05