02-tabulate_stimuli.Rmd 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. ---
  2. title: "Stimuli List"
  3. author: "Jack Taylor"
  4. output: html_document
  5. ---
  6. ```{r setup, include=FALSE}
  7. knitr::opts_chunk$set(echo = TRUE)
  8. library(tidyverse)
  9. ggplot2::theme_set(theme_minimal())
  10. practice_stim_long <- read_csv("practice_stim.csv")
  11. stim_tidy <- read_csv("stim_tidy.csv")
  12. ```
  13. # Practice Trials List
  14. Column name explanations:
  15. * `item_nr`: An identifier for the matched pair of words
  16. * `image`: The image to be displayed in the study (can right-click, open image in new tab to see larger)
  17. * `string`: The practice trial's word
  18. * `condition`: The condition for the practice trial (A1=congruent, A2=incongruent)
  19. * `Zipf`: Word frequency in Zipf (SUBTLEX-UK)
  20. * `Length`: Word length
  21. * `CNC`: Mean concreteness rating
  22. * `BG`: Mean bigram probability
  23. &nbsp;&nbsp;
  24. ```{r, echo=FALSE}
  25. practice_stim_long %>%
  26. mutate(image = sprintf("![](boss_small/%s.jpg)", filename)) %>%
  27. mutate(item_nr = sprintf("Practice %i", item_nr)) %>%
  28. mutate_at(vars(dplyr::matches("Zipf.SUBTLEX_UK")), ~ round(., 2)) %>%
  29. mutate_at(vars(dplyr::matches("cos_ppmi_sim")), ~ round(as.numeric(.), 5)) %>%
  30. mutate_at(vars(dplyr::matches("BG.SUBTLEX_UK")), ~ round(., 5)) %>%
  31. rename(
  32. Zipf = Zipf.SUBTLEX_UK,
  33. sim = cos_ppmi_sim,
  34. CNC = CNC.Brysbaert,
  35. BG = BG.SUBTLEX_UK,
  36. Length = Length
  37. ) %>%
  38. select(item_nr, image, string, condition, Zipf, Length, CNC, BG) %>%
  39. knitr::kable()
  40. ```
  41. # Experimental Trials List
  42. Column name explanations:
  43. * `item_nr`: An identifier for the matched pair of words
  44. * `image`: The image to be displayed in the study (can right-click, open image in new tab to see larger)
  45. * `perc_agree`: The percentage of name agreement for the congruent word
  46. * `string_A1`: The congruent word
  47. * `string_A2`: The incongruent word
  48. * `lev_dist`: The levenshtein distance between the congruent and incongruent words
  49. * `semantic_sim`: The ppmi associative semantic similarity between the congruent and incongruent words
  50. * `Zipf_A1` & `Zipf_A2`: Word frequency in Zipf (SUBTLEX-UK) for each word
  51. * `Length_A1` & `Length_A2`: Word lengths
  52. * `CNC_A1` & `CNC_A2`: Mean concreteness ratings
  53. * `BG_A1` & `BG_A2`: Mean bigram probabilities
  54. * `OLD20_A1` & `OLD20_A2`: OLD20 values (orthographic neighbourhood density)
  55. &nbsp;&nbsp;
  56. ```{r, echo=FALSE}
  57. stim_tidy %>%
  58. mutate(image = sprintf("![](boss_small/%s.jpg)", filename_A1)) %>%
  59. select(item_nr, string_A1, image, nb_diff_names_A1, everything(), -filename_A1, -nb_diff_names_A2) %>%
  60. mutate_at(vars(dplyr::matches("Zipf.SUBTLEX_UK")), ~ round(., 2)) %>%
  61. mutate_at(vars(dplyr::matches("cos_ppmi_sim")), ~ round(as.numeric(.), 5)) %>%
  62. mutate_at(vars(dplyr::matches("BG.SUBTLEX_UK")), ~ round(., 5)) %>%
  63. rename(
  64. nb_diff_names = nb_diff_names_A1,
  65. perc_agree = perc_name_agree_A1,
  66. Zipf_A1 = Zipf.SUBTLEX_UK_A1,
  67. Zipf_A2 = Zipf.SUBTLEX_UK_A2,
  68. sim_A1 = cos_ppmi_sim_A1,
  69. sim_A2 = cos_ppmi_sim_A2,
  70. CNC_A1 = CNC.Brysbaert_A1,
  71. CNC_A2 = CNC.Brysbaert_A2,
  72. BG_A1 = BG.SUBTLEX_UK_A1,
  73. BG_A2 = BG.SUBTLEX_UK_A2,
  74. OLD20_A1 = ON.OLD20_A1,
  75. OLD20_A2 = ON.OLD20_A2,
  76. lev_dist = levenshtein_distance
  77. ) %>%
  78. mutate(
  79. semantic_sim = c(sim_A1, sim_A2)[c(sim_A1, sim_A2)!=1]
  80. ) %>%
  81. arrange(perc_agree) %>%
  82. select(item_nr, image, perc_agree, string_A1, string_A2, lev_dist, semantic_sim, Zipf_A1, Zipf_A2, Length_A1, Length_A2, CNC_A1, CNC_A2, BG_A1, BG_A2, OLD20_A1, OLD20_A2) %>%
  83. knitr::kable()
  84. ```
  85. ## Predictability Distribution
  86. ```{r, echo=FALSE}
  87. pred_hist <- stim_tidy %>%
  88. ggplot(aes(perc_name_agree_A1)) +
  89. geom_bar(width = 1, fill="grey25") +
  90. scale_x_binned(
  91. expand = c(0,0),
  92. n.breaks = 10,
  93. limits=c(0,100)
  94. ) +
  95. scale_y_continuous(expand = c(0,0)) +
  96. labs(x = "Predictability (%)", y = "N Images") +
  97. theme_classic() +
  98. theme(plot.margin = margin(5, 15, 5, 5, unit="pt"))
  99. ggsave(file.path("fig", "pred_hist.svg"), pred_hist, width=6, height=1)
  100. ```