Warning: package 'dplyr' was built under R version 4.3.2
Warning: package 'kableExtra' was built under R version 4.3.2
Warning: package 'dplyr' was built under R version 4.3.2
Warning: package 'kableExtra' was built under R version 4.3.2
Cluster: Cognitive Biases
The pattern perception measure was taken from van Prooijen, Douglas, & De Inocencio (2018), and is based on participants perceptions of the randomness of presented coin flip sequences.
No modifications were made from the original example, except how the sequences were generated. See the Script section below for how this was done.
Participants read the following text for items pp_01 - pp_10:
A coin has two sides, A and B. Please rate the following sequences of coin flips on the degree to which you think they are random or non-random.
NOTE: Item pp_11 is a standalone question with it's own wording
| Qlabel | question |
|---|---|
| pp_01 | B B B A A B A B A B |
| pp_02 | B A A B A A B A B B |
| pp_03 | B B A B A A B B A A |
| pp_04 | A A A A A A B B A A |
| pp_05 | A A A A A B B B A B |
| pp_06 | A A A B B A B B B B |
| pp_07 | B B A A A A B B B A |
| pp_08 | A A B B A B B A A B |
| pp_09 | A B B A B B A B B A |
| pp_10 | A A A B A B B B B B |
| pp_11 | Now imagine that the above sequences represent one long sequence of 100 coin tosses. To what degree do you think it is random or non-random. |
This questionnaire has a bespoke likert scale for randomness. This is used for all items
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| completely random | very random | fairly random | unsure whether random or non-random | fairly non-random | very non-random | completely non-random |
The following variables were derived from this measure:
| Variable Name | Variable Label | Description | Variable Type | Source (Section) | Definition |
|---|---|---|---|---|---|
| Pattern Perception | pattern_percep | Pattern perception score | numeric | Pattern Perception | mean pp_01: pp_10 |
| Pattern Perception (long) | pattern_percep_l | Response to pp_11 | ordinal/ numeric | Pattern Perception | pp_11 |
We created the coin flip sequences in the same manner as van Prooijen et al. (2018), by generating 100 “coin flips” and then splitting this into 10 sequences. However, we used R for this instead of an online randomiser.
First we create 100 values that are either H or T, with a 50% chance of each.
set.seed(78569)
values <- sample(c("H", "T"), size = 100, replace = TRUE, prob = c(0.5, 0.5))We then split this into 10 sequences (1:10, 11:20, 21:30 etc), put these in a dataframe, and check whether any of these sequences are duplicated.
for (i in 1:10) {
assign(paste0("seq", i), values[((i - 1) * 10 + 1):(i * 10)])
}
df <- data.frame(seq1, seq2, seq3, seq4, seq5, seq6, seq7, seq8, seq9, seq10)
duplicated(colnames(df)) #check for duplicatesFor ease of copy and pasting we paste the values sequence we want (e.g. seq 2)
noquote(df$seq2) #noquote removes "" from the values to make copying easier