LearningToTalk / L2TDatabase

Helper functions for working with our lab's MySQL database
GNU General Public License v2.0
0 stars 0 forks source link

Add audio stimulus version to eyetracking database #73

Closed tjmahr closed 7 years ago

tjmahr commented 7 years ago

Currently I need to jump through some hoops to figure out which recordings were used in a task. Let's have this pre-computed.

tjmahr commented 7 years ago

Did a little sleuthing to create a reference table https://github.com/LearningToTalk/eyetracking-experiments/blob/master/stimulus-timings.md

tjmahr commented 7 years ago

Added new StimulusSet rows to BlockAttributes table in eyetracking database.

library(dplyr)
library(L2TDatabase)
cnf_file <- "./inst/l2t_db.cnf"
l2t_eyetracking <- l2t_connect(cnf_file, "eyetracking")

# Get the information about the experiment administration
tbl(l2t_eyetracking, "q_BlockAttributesByStudy") %>% 
  # Keep just the StimulusSet rows
  filter(BlockAttribute_Name == "StimulusSet") %>% 
  # Count the Stimuli used in each Study x Task
  count(Study, Task, BlockAttribute_Value) %>% 
  # Clean up / Download query results
  ungroup() %>% 
  collect() %>% 
  rename(NumBlocks = n, StimulusSet = BlockAttribute_Value) %>% 
  knitr::kable()
Study Task StimulusSet NumBlocks
CochlearMatching MP TP2 7
CochlearMatching RWL TP2 9
CochlearV1 MP TP2 47
CochlearV1 RWL TP2 45
CochlearV2 MP TP2 20
CochlearV2 RWL TP2 20
DialectDensity RWL TP1 26
DialectSwitch RWL TP1 90
DialectSwitch RWL TP2 83
LateTalker MP TP1 3
LateTalker MP TP2 12
LateTalker RWL TP2 16
MaternalEd MP TP1 6
MaternalEd MP TP2 34
MaternalEd RWL TP1 2
MaternalEd RWL TP2 39
TimePoint1 MP TP1 399
TimePoint1 RWL TP1 384
TimePoint2 MP TP2 350
TimePoint2 RWL TP2 347
TimePoint3 MP TP2 326
TimePoint3 RWL TP2 322