Last updated: 2022-11-09

Checks: 7 0

Knit directory: SCHEDULING/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20221107) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 67e1aac. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rproj.user/
    Ignored:    analysis/patch_selection.png
    Ignored:    analysis/patch_selection_8.png
    Ignored:    analysis/patch_selection_avg.png

Untracked files:
    Untracked:  analysis/Notes.txt
    Untracked:  analysis/archive/
    Untracked:  analysis/fd_pl.rds
    Untracked:  analysis/fu_pl.rds
    Untracked:  analysis/prereg/
    Untracked:  analysis/reward rate analysis.docx
    Untracked:  analysis/rewardRate.jpg
    Untracked:  analysis/toAnalyse/
    Untracked:  analysis/wflow_code_string.txt
    Untracked:  archive/
    Untracked:  data/archive/
    Untracked:  data/create_database.sql
    Untracked:  data/dataToAnalyse/
    Untracked:  data/exp6a_typing_exponential.xlsx
    Untracked:  data/exp6b_typing_linear.xlsx
    Untracked:  data/rawdata_incEmails/
    Untracked:  data/sona data/
    Untracked:  data/summaryFiles/
    Untracked:  models/
    Untracked:  old Notes on analysis.txt
    Untracked:  presentations/
    Untracked:  references/
    Untracked:  spatial_pdist.Rdata

Unstaged changes:
    Modified:   data/README.md

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/analysis_exp4_8tasks_labelled_delay.Rmd) and HTML (docs/analysis_exp4_8tasks_labelled_delay.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 67e1aac knowlabUnimelb 2022-11-09 Publish data and analysis files

Daniel R. Little1, Ami Eidels2, and Deborah J. Lin1

1 The University of Melbourne, 2 The University of Newcastle

Method

Participants

We tested 49 participants (37 F, 9 M, 3 Undeclared). Participants were recruited through the Melbourne School of Psychological Sciences Research Experience Pool (Mean age = 20.44, range = 18 - 40). Participants were reimbursed with credit toward completion of a first year psychology subject. Datasets from 0 subjects were excluded for completing the experiment twice; i.e., only the first of the datasets for these subjects was retained.

Forty-nine were assigned to the Fixed Difficulty condition. In this condition, the location of the difficulty of the random dot kinematograms (RDK’s) was held constant across trials.

Design

In each condition, participants completed multiple trials in which they selected and completed RDK tasks. On each trial, participants were shown a set of eight RDKs labelled from Very Easy to Very Hard. The labels corresponded to the coherence of the RDK; that is, the proportion of dots moving in a coherent direction was set to 80% to 10% in steps of 10%. From the set of eight RDKs, participants selected and completed one RDK at a time in any order. The goal of each trial was to complete as many as possible before a deadline. If an incorrect RDK response was made, that RDK was restarted at the same coherence but with a resampled direction (so the direction may have changed), and the participant had to respond to the RDK again. A new task could not be selected until the RDK was completed successfully.

Participants first completed 10 trials with a long (30 sec) deadline to help participants learn the task, explore strategies, and allow for comparison to a short-deadline condition. We term this the no deadline condition since the provided time is well beyond what is necessary to complete all eight RDK’s. Next, participants completed 30 trials with a 10 second deadline.

Data Cleaning

Subjects completed the experiment by clicking a link with the uniquely generated id code. Subjects were able to use the link multiple times; further, subjects were able to exit the experiment at any time. Consequently, the datafile contains partially completed data for some subjects which needed to be identified and removed.

A handful of subjects (N = 3) had less than chance accuracy on the easiest RDK indicating equipment problems or a misunderstanding of task directions. We removed these participants from further anlaysis leaving 46 and in the fixed and random location conditions, respectively.

Data Analysis

We first summarize performance by answering the following questions:

Task completions

  • How many tasks are completed on average?
Average number of correctly completed tasks in each condition
condition phase mean
fixed untimed 7.675381
fixed deadline 7.210870

RDK performance

We next analysed performance on the RDK discriminations. We then asked:

  • What was the average completion time and accuracy of the easy, medium, hard, and very hard tasks?

RTs became shorter and more accurate as the difficulty of the RDK became easier. As expected, the RTs were shorter under a deadline than without a deadline. We visualised the response times in two ways: First, we simply took the average of each attempt on each RDK.

Second, we computed the time to complete an RDK as the cumulative sum across multiple attempts within a trial (termed Cumulative RT or cRT). That is, if an error is made and the RDK needs to be repeated, then the total RT is the sum of both attempts.

We further broke down RTs by condition, deadline, and difficulty.

Mean accuracy, RT, and RT summed across attempts for each difficulty and each phase
condition phase difficulty n Mean.Correct SE.Correct Mean.RT SE.RT Mean.crt SE.crt
fixed untimed 1 727 0.91 0.01 770.93 38.17 845.93 41.08
fixed untimed 2 606 0.89 0.01 744.43 23.25 839.78 29.95
fixed untimed 3 569 0.89 0.01 724.05 20.27 817.84 26.21
fixed untimed 4 502 0.87 0.01 799.16 43.34 913.07 50.46
fixed untimed 5 505 0.88 0.01 801.39 25.69 912.24 35.54
fixed untimed 6 497 0.78 0.02 923.72 44.77 1186.45 61.30
fixed untimed 7 502 0.73 0.02 970.36 41.66 1336.45 68.13
fixed untimed 8 485 0.60 0.02 1068.34 47.91 1785.47 95.16
fixed deadline 1 1761 0.92 0.01 532.96 4.28 576.90 5.82
fixed deadline 2 1628 0.91 0.01 525.25 3.79 574.23 5.93
fixed deadline 3 1507 0.91 0.01 542.01 4.56 595.54 6.29
fixed deadline 4 1406 0.90 0.01 549.03 4.84 605.80 7.67
fixed deadline 5 1430 0.87 0.01 565.69 5.61 642.98 8.53
fixed deadline 6 1402 0.81 0.01 595.45 7.09 727.78 12.22
fixed deadline 7 1442 0.71 0.01 620.58 7.98 840.51 15.32
fixed deadline 8 1418 0.67 0.01 651.11 8.99 939.07 18.15

Reward Rate

Optimality in each condition

Having now established that the RDK’s are ordered in accuracy, difficulty, and reward rate, it is clear that the task set presented to each subject has an optimal solution, ordered from easiest to most difficult. We now ask:

  • What is the proportion of easy, medium, hard, and very hard tasks selected first, second, third or fourth?

We first compute the marginal distribution of the ranks of each of the tasks; in other words, what are the proportions of the ranks of each task in each rank position. These matrices indicate the proportions of responses for each difficulty level which were chosen first, second, third, or fourth, respectively. The matrix from a dataset in which choice is always optimal would have ones on the diagonal and zeros on the off-diagonal.

  • Do the marginal distributions differ from uniformity?

We tested whether the marginal distributions were different from uniformally random selection using the fact that the mean rank is distributed according to a \(\chi^2\) distribution with the following test-statistic: \[\chi^2 = \frac{12N}{k(k+1)}\sum_{j=1}^k \left(m_j - \frac{k+1}{2} \right)^2\] see (Marden, 1995).

Chi2 test of uniformity
condition phase chi2 df p
fixed untimed 254.11 3 0
fixed deadline 1338.19 3 0

It is evident at a glance that the ordering of choices is more optimal when the locations are fixed; that is, the proportions on the diagonal are higher. When the locations are fixed, choice order becomes more optimal under a deadline. By contrast, when locations are random, responding becomes less optimal under a deadline. This likely reflects the additional costs of having to search for the appropriate task to complete. This search is minimised in the fixed location condition.

We compared the location conditions and phases using chi-2 analysis.

Pearson’s chi-squared test
Comparison chi2 df p
X-squared Fixed: Untimed vs Deadline 154.23 63 0
  • How optimal were responses?

The next analysis computed the distance between the selected order and the optimal order (easiest to very hard for that trial), which ranges between 0 (perfect match) and 6 (maximally distant), for 4 options.

What we want is the distance of the selected options from the optimal solutions, which is the edit distance (or number of discordant pairs) between orders. However, because a participant may run out of time, there may be missing values. To handle these values, for each trial, we find the orders which partially match the selected order and compute three the average distance of those possible orders and the optimal solution (avg_distance).

The following figure compares the avg_distance between the fixed difficulty and random difficulty conditions as a function of deadline condition and phase. For each of these measures, lower values reflect respones which are closer to optimal.

# Selection model

We can treat each task selection as a probabilistic choice given by a Luce’s choice rule (Luce, 1959), where each task is represented by some strength, \(\nu\). The probability of selecting task \(i_j\) from set \(S = \left{i_1, i_2, ..., i_J \right}\), where J is the number of tasks, is:

\[p\left(i_j |S \right) = \frac{\nu_{i_j}}{\sum_{i \in S} \nu_{i}} \].

Plackett (1975) generalised this model to explain the distribution over a sequence of choices (i.e., ranks). In this case, after each choice, the choice set is reduce by one (i.e., sampling without replacement). This probability of observing a specific selection order, \(i_1 \succ ... \succ i_J\) is:

\[p\left(i_j |A \right) = \prod_{j=1}^J \frac{\nu_{i_j}}{\sum_{i \in A_j} \nu_{i}} \],

where \(A_j\) is the current choice set.

Selection Choice RTs

Mean RTs for each scheduling selection
condition phase mrt_sel1 mrt_sel2 mrt_sel3 mrt_sel4 mrt_sel5 mrt_sel6 mrt_sel7 mrt_sel8
fixed untimed 1531 905 798 769 737 689 682 730
fixed deadline 671 470 478 500 515 503 497 490


sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats4    grid      stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] pmr_1.2.5.1       jpeg_0.1-9        rstatix_0.7.0     lme4_1.1-29      
 [5] Matrix_1.4-0      png_0.1-7         reshape2_1.4.4    knitr_1.38       
 [9] hrbrthemes_0.8.0  english_1.2-6     gtools_3.9.2      DescTools_0.99.45
[13] forcats_0.5.1     stringr_1.4.0     dplyr_1.0.8       purrr_0.3.4      
[17] readr_2.1.2       tidyr_1.2.0       tibble_3.1.6      ggplot2_3.3.5    
[21] tidyverse_1.3.1   workflowr_1.7.0  

loaded via a namespace (and not attached):
 [1] minqa_1.2.4       colorspace_2.0-3  ellipsis_0.3.2    class_7.3-20     
 [5] rprojroot_2.0.3   fs_1.5.2          gld_2.6.5         rstudioapi_0.13  
 [9] proxy_0.4-27      farver_2.1.0      fansi_1.0.3       mvtnorm_1.1-3    
[13] lubridate_1.8.0   xml2_1.3.3        splines_4.1.3     extrafont_0.18   
[17] rootSolve_1.8.2.3 jsonlite_1.8.0    nloptr_2.0.0      broom_0.8.0      
[21] Rttf2pt1_1.3.10   dbplyr_2.1.1      compiler_4.1.3    httr_1.4.2       
[25] backports_1.4.1   assertthat_0.2.1  fastmap_1.1.0     cli_3.2.0        
[29] later_1.3.0       htmltools_0.5.2   tools_4.1.3       gtable_0.3.0     
[33] glue_1.6.2        lmom_2.9          Rcpp_1.0.8.3      carData_3.0-5    
[37] cellranger_1.1.0  jquerylib_0.1.4   vctrs_0.4.1       nlme_3.1-155     
[41] extrafontdb_1.0   xfun_0.30         ps_1.6.0          rvest_1.0.2      
[45] lifecycle_1.0.1   getPass_0.2-2     MASS_7.3-55       scales_1.2.0     
[49] hms_1.1.1         promises_1.2.0.1  expm_0.999-6      yaml_2.3.5       
[53] Exact_3.1         gdtools_0.2.4     sass_0.4.1        stringi_1.7.6    
[57] highr_0.9         e1071_1.7-11      boot_1.3-28       rlang_1.0.2      
[61] pkgconfig_2.0.3   systemfonts_1.0.4 evaluate_0.15     lattice_0.20-45  
[65] labeling_0.4.2    processx_3.5.3    tidyselect_1.1.2  plyr_1.8.7       
[69] magrittr_2.0.3    R6_2.5.1          generics_0.1.2    DBI_1.1.2        
[73] pillar_1.7.0      haven_2.5.0       whisker_0.4       withr_2.5.0      
[77] abind_1.4-5       modelr_0.1.8      crayon_1.5.1      car_3.0-12       
[81] utf8_1.2.2        tzdb_0.3.0        rmarkdown_2.13    readxl_1.4.0     
[85] data.table_1.14.2 callr_3.7.0       git2r_0.30.1      reprex_2.0.1     
[89] digest_0.6.29     httpuv_1.6.5      munsell_0.5.0     bslib_0.3.1