Coder Social home page Coder Social logo

jspsychhelper's People

Contributors

gorkang avatar

Stargazers

 avatar  avatar

Watchers

 avatar

jspsychhelper's Issues

Experimental tasks

We need to develop a few things to process Experimental tasks:

  • Implement a template where the between and within columns are taken into account
  • Make sure to export both wide and long versions of the output.
  • save_files(): include parameter to trigger saving both wide and long versions
  • Final DF with experimental task in long version and non-experimental wide tasks added?
  • condition_between and condition_within SHOULD include task name? If we have more than one experimental task in the protocol, will MISS INFORMATION

Example FONDECYT2022E1

Support reading files from a zip?

Storing data files in a tar with gzip compression has some important advantages:

  • Space reduction and less files (e.g. 9765 files: 35.6 MB -> 3.1 MB)

Drawbacks:

  • Time to compress raw files (e.g. 9765 files: 3s) (see below for other compression algorithms)
  • Time to decompress and delete with each project run: (e.g. 9765 files: 7.2s now -> 7.7s zip)

See initial implementation: dev/read_ZIP.R

Compression

bzip2: 5.91s | 1.9 Mb
gzip: 3.01s | 3 Mb
xz: 12.05s | 2 Mb
none: 3.37s | 41.3 Mb

Q0 remains in some cases

In multi-select questions such as DEMOGR_19 Q0 remains in response if response empty.

Careful with create_clean_data changes, as they can easily interfere with separate_responses() resulting in errors in PRFBM_04 and similar items with multiple responses per screen.

Within variables

The column condition_within should be in the csv outputs when one or more within variables are used.

The within variables names stored in condition_within SHOULD be in camelCase separated by "_", so we can process them.

Examples:

  • Good condition_within content: conditionOne_conditionTwo
  • Bad condition_within content: conditionOne_condition number two.

When we find Bad names, a potential solution is something like this below, but it is slooooow because first splits each vector for each row, transforms to camelCase and finally pastes the strings together separated by "_":

DFX = DF_clean %>% filter(experimento == "FONDECYT") %>% select(trialid, condition_within) 

DFX %>% 
  rowwise() %>% 
  mutate(condition_within_camel = paste(map_chr(str_split(condition_within, pattern = "_", simplify = TRUE), janitor::make_clean_names, case = "small_camel"), collapse = "_"))

Maybe trigger this ONLY if we find spaces or "-" in the condition_within column?

Implementar nuevas tareas

See new tasks in dev/ALL_PROTOCOLS.R

Updated on 2022-06-14:

  • BDI
  • CEL
  • CGT
  • CRQ
  • DEMOGR3
  • DEMOGRfondecyt2022E1
  • ESV
  • HC
  • ICvsID
  • ITC
  • LOT
  • LSNS
  • MCA
  • MCQ30
  • MDDF
  • MLQ
  • NARS
  • PERMA
  • PPD
  • ProQOLCV
  • PSC
  • RobToM
  • TCS
  • UCLA
  • Words
  • ZARIT

Maker/Helper: DEMOGR

Buscar manera de crear una sola prueba DEMOGR con TODAS las alternativas habitualmente usadas. Crear sistema para seleccionar subconjunto de preguntas.

Avoid grepl in prepare_TASK

Avoid grepl in # Create long DIR chunk, as it can be ambiguous. Lots of tasks use this now.

Example:

  • grepl("01|02", trialid) & RAW == "Varias veces a la semana" ~ 1,

Matches TASK_01, TASK_011, TASK_012...

Will cause issues when we generalize the use of 3 digit trialid's

copy of full protocol

A copy of the full protocol (jsPsychMaker) should be available zipped.

  1. For reproducibility
  2. Can check questions with if_question for tests

Maybe the run_initial_setup() could download not only the data but also the full protocol and zip it

Create and remove snapshots should be part of run_initial_setup()?

Should add the output of these lines to test-snapshots.R:

  # CREATE SNAPSHOTS TEST LINES
    # FILES_TO_SNAPSHOT = list.files(path = "outputs/data", pattern = "df_.*csv$", full.names = TRUE, ignore.case = FALSE)
    # FILES_TO_SNAPSHOT %>% walk(~ cat(paste0('testthat::expect_snapshot_file(here::here("', .x, '"))\n')))

Right now, the system checks for all the snapshots of canonical protocol!

Create R package

  • template to create R project
  • function to build _targets.R reading a maker project folder or an index.html

Should not use all items for total score of SWBQ

  1. Se decidió dejar el instrumento con 26 items para tener la opción de observar en estos datos cómo se comportan los items. Así que está bien que tenga 26 preguntas el instrumento.
  2. El cálculo de dimensiones también está correcto, se calculan en base a la propuesta del paper, a menos que quien analice esta escala en el futuro diga lo contrario y decida usar los items originales, pero por ahora se mantiene así.
  3. Lo único que hay que revisar es que la sumatoria del puntaje total sea en base a la suma de las dimensiones y no de los 26 items.

REMEMBER: create report sub_protocol

We can run a set of targets using THIS:

targets::tar_make(c('target1', 'target2'), callr_function = NULL)

DO NOT MARK TARGETS as Up to date

targets::tar_make(c('DF_analysis'), callr_function = NULL)

MARK TARGETS as Up to date

targets::tar_make(c('DF_analysis'))

Parametro similar a accept_discarded para continuar donde lo dejaron

Ahora mismo, si el participante recarga la web, continua donde lo dejo (reinicia la ultima prueba no completada).

Un problema asociado es que, un participante puede reintentar una tarea con F5.

Deberiamos tener un parametro similar a accept_discarded para continuar o no donde lo dejaron?

  • Es posible mantener un archivo temporal oculto para cada participante donde se guarda el csv de salida linea a linea ? De ese modo, podriamos continuar exactamente donde lo dejaron...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.