順序関係

前処理

eye_2 <- read_csv("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/User\ 4_all_gaze.csv")
## New names:
## Rows: 42649 Columns: 5
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (4): TIME(2022/08/02 16:53:22.834), TIMETICK(f=10000000), LPMM, LPMMV lgl (1):
## ...5
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...5`
colnames(eye_2) <- c("Time", "TIMETICK", "LPMM", "LPMMV", "Timebin")

eye_2 <- eye_2 %>% filter(LPMMV == 1)
eye_2 <- eye_2 %>% filter(LPMM < 5)

eye_2$Timebin <- c(1:29922)
eye_2$id <- c("1")
eye_2$type <- c("jyunjyo2")

eye_1 <- read_csv("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/User\ 6_all_gaze.csv")
## New names:
## Rows: 24659 Columns: 5
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (4): TIME(2022/08/02 17:22:13.018), TIMETICK(f=10000000), LPMM, LPMMV lgl (1):
## ...5
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...5`
colnames(eye_1) <- c("Time", "TIMETICK", "LPMM", "LPMMV", "Timebin")

eye_1 <- eye_1 %>% filter(LPMMV == 1)
eye_1 <- eye_1 %>% filter(LPMM < 5)

eye_1$Timebin <- c(1:17402)
eye_1$id <- c("1")
eye_1$type <- c("jyunjyo1")


eye_all <- rbind(eye_1, eye_2)


pupil_eye_all <- make_pupillometryr_data(data = eye_all, 
                                      subject = id, 
                                      trial = LPMMV, 
                                      time = Time,
                                      condition = type)

ローデータの図

何もわからないが

plot(pupil_eye_all, pupil = LPMM, group = 'condition')+ ggtitle("RAW DATA JYUNJO")

Downsample

10秒間隔で中央値をとる。

#downsample

mean_data <- downsample_time_data(data = pupil_eye_all,
                                  pupil = LPMM,
                                  timebin_size = 10,
                                  option = 'median')
## Calculating median pupil size in each timebin
#plot(mean_data, pupil = LPMM, group = 'condition') 

ggplot(mean_data, aes(x = Time, y = LPMM, color = type)) + geom_line() + ggtitle("JYUNJO Downsample")

フィルタリング色々

filtered_data <- filter_data(data = mean_data,
                             pupil = LPMM,
                             filter = 'median',
                             degree = 11)
## Performing median filter
int_data <- interpolate_data(data = filtered_data,
                             pupil = LPMM,
                             type = 'linear')
## Performing linear interpolation
#plot(int_data, pupil = LPMM, group = 'condition')


ggplot(int_data, aes(x = Time, y = LPMM, color = type)) + geom_line() + ggtitle("JYUNJO INTERPOLATE")

集合問題

前処理

eye_3 <- read_csv("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/User\ 8_all_gaze.csv")
## New names:
## Rows: 16758 Columns: 5
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (4): TIME(2022/08/02 17:34:49.312), TIMETICK(f=10000000), LPMM, LPMMV lgl (1):
## ...5
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...5`
colnames(eye_3) <- c("Time", "TIMETICK", "LPMM", "LPMMV", "Timebin")

eye_3 <- eye_3 %>% filter(LPMMV == 1)
eye_3 <- eye_3 %>% filter(LPMM < 5)

eye_3$Timebin <- c(1:12353)
eye_3$id <- c("1")
eye_3$type <- c("syugo1")



eye_4 <- read_csv("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/User\ 10_all_gaze.csv")
## New names:
## Rows: 22159 Columns: 5
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (4): TIME(2022/08/02 17:45:40.557), TIMETICK(f=10000000), LPMM, LPMMV lgl (1):
## ...5
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...5`
colnames(eye_4) <- c("Time", "TIMETICK", "LPMM", "LPMMV", "Timebin")

eye_4 <- eye_4 %>% filter(LPMMV == 1)
eye_4 <- eye_4 %>% filter(LPMM < 5)

eye_4$Timebin <- c(1:11803)
eye_4$id <- c("1")
eye_4$type <- c("syugo2")


eye_syugo <- rbind(eye_3, eye_4)

pupil_eye_all <- make_pupillometryr_data(data = eye_syugo, 
                                         subject = id, 
                                         trial = LPMMV, 
                                         time = Time,
                                         condition = type)

ローデータ

plot(pupil_eye_all, pupil = LPMM, group = 'condition')

Downsample

mean_data <- downsample_time_data(data = pupil_eye_all,
                                  pupil = LPMM,
                                  timebin_size = 10,
                                  option = 'median')
## Calculating median pupil size in each timebin
#plot(mean_data, pupil = LPMM, group = 'condition')

ggplot(mean_data, aes(x = Time, y = LPMM, color = type)) + geom_line() + ggtitle("SYUGO Downsample")

フィルタリング

filtered_data <- filter_data(data = mean_data,
                             pupil = LPMM,
                             filter = 'median',
                             degree = 11)
## Performing median filter
int_data <- interpolate_data(data = filtered_data,
                             pupil = LPMM,
                             type = 'linear')
## Performing linear interpolation
ggplot(int_data, aes(x = Time, y = LPMM, color = type)) + geom_line() + ggtitle("SYUGO INTERPOLATE")

嘘つき問題

前処理

eye_5 <- read_csv("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/User\ 12_all_gaze.csv")
## New names:
## Rows: 26122 Columns: 5
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (4): TIME(2022/08/01 19:39:15.207), TIMETICK(f=10000000), LPMM, LPMMV lgl (1):
## ...5
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...5`
colnames(eye_5) <- c("Time", "TIMETICK", "LPMM", "LPMMV", "Timebin")

eye_5 <- eye_5 %>% filter(LPMMV == 1)
eye_5 <- eye_5 %>% filter(LPMM < 5)

eye_5$Timebin <- c(1:23537)
eye_5$id <- c("1")
eye_5$type <- c("uso2")


eye_6 <- read_csv("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/User\ 14_all_gaze.csv")
## New names:
## Rows: 25569 Columns: 5
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (4): TIME(2022/08/01 19:54:53.861), TIMETICK(f=10000000), LPMM, LPMMV lgl (1):
## ...5
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...5`
colnames(eye_6) <- c("Time", "TIMETICK", "LPMM", "LPMMV", "Timebin")

eye_6 <- eye_6 %>% filter(LPMMV == 1)
eye_6 <- eye_6 %>% filter(LPMM < 5)

eye_6$Timebin <- c(1:20067)
eye_6$id <- c("1")
eye_6$type <- c("uso1")

eye_uso <- rbind(eye_5, eye_6)

pupil_eye_all <- make_pupillometryr_data(data = eye_uso, 
                                         subject = id, 
                                         trial = LPMMV, 
                                         time = Time,
                                         condition = type)

ローデータ

plot(pupil_eye_all, pupil = LPMM, group = 'condition')

Downsample

mean_data <- downsample_time_data(data = pupil_eye_all,
                                  pupil = LPMM,
                                  timebin_size = 10,
                                  option = 'median')
## Calculating median pupil size in each timebin
#plot(mean_data, pupil = LPMM, group = 'condition')

ggplot(mean_data, aes(x = Time, y = LPMM, color = type)) + geom_line() + ggtitle("USO Downsample")

## フィルタリング

filtered_data <- filter_data(data = mean_data,
                             pupil = LPMM,
                             filter = 'median',
                             degree = 11)
## Performing median filter
int_data <- interpolate_data(data = filtered_data,
                             pupil = LPMM,
                             type = 'linear')
## Performing linear interpolation
ggplot(int_data, aes(x = Time, y = LPMM, color = type)) + geom_line() + ggtitle("USO INTERPOLATE")

瞳孔径データとGSRデータを合わせてみると

library(ggplot2)
library(dplyr)
library(patchwork) # To display 2 charts together
library(hrbrthemes)
## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
##       Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
##       if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow
pupil_eye_all <- make_pupillometryr_data(data = eye_2, 
                                      subject = id, 
                                      trial = LPMMV, 
                                      time = Time,
                                      condition = type)

mean_data_jyunjyo2 <- downsample_time_data(data = pupil_eye_all,
                                  pupil = LPMM,
                                  timebin_size = 10,
                                  option = 'median')
## Calculating median pupil size in each timebin
filtered_data <- filter_data(data = mean_data_jyunjyo2,
                             pupil = LPMM,
                             filter = 'median',
                             degree = 11)
## Performing median filter
int_data_jyunjyo2 <- interpolate_data(data = filtered_data,
                             pupil = LPMM,
                             type = 'linear')
## Performing linear interpolation
##GSR
gsr <- read.table("/Users/riku/Dropbox/zemizemi/experiment_d/shan/redata/yobi2_Session5_Shimmer_204B_Calibrated_PC.csv", sep = "\t", skip = 2, header = T)

colnames(gsr) <- c("Time", "no_units", "uS", "kOhms", "mV", "X")

gsr$Time <- gsr$Time-1659426807320
gsr$Time <- gsr$Time/1000

alldata <- full_join(gsr, int_data_jyunjyo2)
## Joining, by = "Time"
temperatureColor <- "#E94560"
priceColor <- "#533483"
# Value used to transform the data
coeff <- 40

ggplot(alldata, aes(x=Time)) +
  
  geom_point( aes(y=LPMM), size=2, color=temperatureColor) + 
  geom_line( aes(y=kOhms / coeff), size=1, color=priceColor) + # Divide by 10 to get the same range than the temperature
  
  scale_y_continuous(
    
    # Features of the first axis
    name = "PUPIL",
    
    # Add a second axis and specify its features
    sec.axis = sec_axis(~.*coeff, name="GSR")
  ) + 
  
  theme_ipsum() +

  theme(
    axis.title.y = element_text(color = temperatureColor, size=13),
    axis.title.y.right = element_text(color = priceColor, size=13)
  ) +

  ggtitle("PUPIL AND GSR")
## Warning: Removed 35801 rows containing missing values (geom_point).
## Warning: Removed 1 row(s) containing missing values (geom_path).

SEデータも含める図を提示

文献

Pupil dilation as an index of effort in cognitive control tasks: A review

https://link.springer.com/article/10.3758/s13423-018-1432-y

To sum up, most studies using updating tasks have shown that pupil dilation increases with increasing task demands. When approaching working memory capacity limitations, pupil dilation plateaus or drops, depending on task instructions. Moreover, although not found in all studies (Ahern & Beatty, 1979), some studies on inter-individual differences have revealed that increased pupil dilation is associated with enhanced performance (Rondeel et al., 2015; Van Der Meer et al., 2010), suggesting that in these contexts pupil dilation might index the amount of effort allocated to the task at hand.

Galvanic skin response (GSR) as an index of cognitive load

https://dl.acm.org/doi/10.1145/1240866.1241057

GSR readings significantly increase when task cognitive load level increases

図からずれがあると見られるが、遅延か、異なる種類の負荷を示しているかと考えられる。