This function calculates the proportion correct of each item in the serial position curve. Data should include the participant's answers in long format (use arrange_data() in this package for help), the answer key of the items in order, and a column that denotes the order a participant listed each item. The function will then calculate the items remembered within a window of 1 before or 1 after the tested position. The first and last positions must be answered in the correct place.

serial_position(data, position, answer, 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.

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_Serial

A dataframe of the proportion correct for each tested position by any optional grouping variables included.

Details

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

Important: The code is written assuming group.by variables are between subjects for an individual 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")

serial_output <- serial_position(data = scored_output$DF_Scored,
 key = answer_key_free2$Answer_Key,
 position = "position",
 scored = "Scored",
 answer = "Answer",
 group.by = "Version")

 head(serial_output)
#>   Version Tested.Position Freq Proportion.Correct         SE
#> 1       A               1    2          0.1000000 0.06708204
#> 2       C               1    0          0.0000000 0.00000000
#> 3       E               1    0          0.0000000 0.00000000
#> 4       A               2    1          0.0500000 0.04873397
#> 5       C               2    0          0.0000000 0.00000000
#> 6       E               2    4          0.2105263 0.09352877