Title: | Utility Functions for Data Processing of Iquizoo Games |
---|---|
Description: | Several couples of games are developed by IQUIZOO.COM. Here are the functions used to do data processing for all of those games. |
Authors: | Liang Zhang [aut, cre] |
Maintainer: | Liang Zhang <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.8.2 |
Built: | 2024-11-17 04:39:56 UTC |
Source: | https://github.com/psychelzh/preproc.iquizoo |
The indices for ANT task are calculated.
ant_orient(data, .by = NULL, .input = NULL, .extra = NULL) ant_alert(data, .by = NULL, .input = NULL, .extra = NULL)
ant_orient(data, .by = NULL, .input = NULL, .extra = NULL) ant_alert(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
Executive function score (prefix cong_eff
), total orienting scores
(prefix orient
), endogenous orienting scores (prefix orient_endo
),
exogenous orienting scores (prefix orient_exo
), total alerting scores
(prefix alert
), audio alerting scores (prefix alert_aud
) and visual
alerting scores (prefix alert_vis
) for the following performances:
pc |
Percent of correct. |
mrt |
Mean reaction time. |
ies |
Inverse efficiency score. |
rcs |
Rate correct score. |
lisas |
Linear integrated speed-accuracy score. |
This task is deemed as a measure of impulsivity.
bart(data, .by = NULL, .input = NULL, .extra = NULL)
bart(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
mean_pumps |
Mean of hits for balloons not exploded. |
mean_pumps_raw |
Mean of hits for all balloons. |
num_explosion |
Number of exploded balloons. |
This function mainly calculates the "BPS score" developed by Stark et al. (2013).
bps(data, .by = NULL, .input = NULL, .extra = NULL)
bps(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
pc |
Percent of correct responses. |
p_sim_target |
Percent of similar responses for "target" stimuli. |
p_sim_lure |
Percent of similar responses for "lure" stimuli. |
p_sim_foil |
Percent of similar responses for "foil" stimuli. |
bps_score |
BPS score. |
The visual arrays task is used to measure working memory capacity. Here we calculate the capacity from data. Note this is used when the whole visual arrays are to be detected.
capacity(data, .by = NULL, .input = NULL, .extra = NULL)
capacity(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
k |
The mean capacity in all conditions. |
k3 |
The capacity in condition of 3 arrays. |
k5 |
The capacity in condition of 5 arrays. |
k7 |
The capacity in condition of 7 arrays. |
k9 |
The capacity in condition of 9 arrays. |
This is an self-adaptive version (item number is adaptive to user's ability) of filtering task. Only two conditions are included, i.e., condition of no distractor and condition of two distractors.
condstairs(data, .by = NULL, .input = NULL, .extra = NULL)
condstairs(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
capacity0 |
The mean number of target in condition of no distractors. |
capacity2 |
The mean number of target in condition of 2 distractors. |
capacity |
The mean number of target in both conditions. |
efficiency |
The filtering efficiency, .i.e, difference between condition of no distractors and two distractors. |
These functions count the number of correct responses. countcorrect()
counts the correct responses regardless of errors, countcorrect2()
subtracts the number of errors from number of correct responses,
sumweighted()
counts the correct responses by giving a weight for different
responses, sumscore()
adds up the score for each response.
countcorrect(data, .by = NULL, .input = NULL, .extra = NULL) countcorrect2(data, .by = NULL, .input = NULL, .extra = NULL) sumweighted(data, .by = NULL, .input = NULL, .extra = NULL) sumscore(data, .by = NULL, .input = NULL, .extra = NULL)
countcorrect(data, .by = NULL, .input = NULL, .extra = NULL) countcorrect2(data, .by = NULL, .input = NULL, .extra = NULL) sumweighted(data, .by = NULL, .input = NULL, .extra = NULL) sumscore(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc |
Count of correct responses. For |
nc_cor |
Corrected count of correct responses (subtracting number of
errors). For |
nc_weighted |
Count of weighted correct responses. For
|
nc_score |
Sum of scores. For |
Continuous Performance Test (CPT) is a classical test for attention. There are many methods used to calculate the performance index of this task, and here only includes those common ones.
cpt(data, .by = NULL, .input = NULL, .extra = NULL)
cpt(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc |
Count of correct responses. |
mrt |
Mean reaction time of hits. |
rtsd |
Standard deviation of reaction times of hits. |
dprime |
Sensitivity (d'). |
commissions |
Number of errors caused by action. |
omissions |
Number of errors caused by inaction. |
A test measuring impulsivity originally developed by Gardner et al (2005).
driving(data, .by = NULL, .input = NULL, .extra = NULL)
driving(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
still_ratio |
The ratio of still duration in yellow light state. |
This is a classical false memory test. Here calculates the effect size of false memory.
drm(data, .by = NULL, .input = NULL, .extra = NULL)
drm(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
tm_dprime |
Sensitivity (d') of true memory (against "foil" stimuli). |
tm_bias |
Bias of true memory (against "foil" stimuli). |
fm_dprime |
Sensitivity (d') of false memory. |
fm_bias |
Bias of false memory. |
memory_score |
Memory score ( |
This model assumes the distribution of mental representation for a given number/count k is N(k, (w * k) ^ 2).
fit_numerosity(data, name_bigset, name_smallset, name_acc, n_fit = 5, seed = 1)
fit_numerosity(data, name_bigset, name_smallset, name_acc, n_fit = 5, seed = 1)
data |
Raw data of class |
name_bigset , name_smallset
|
Variable name in |
name_acc |
Variable name in |
n_fit |
Number of fits to try to find the best estimate. |
seed |
Random seed. Default is 1 so that results can be reproduced. |
A list()
with structure the same as optim()
.
This is used to do face name task indicator calculations. Current version integrates a occupation memory task.
fname(data, .by = NULL, .input = NULL, .extra = NULL)
fname(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
Following Amariglio et al. (2012), we will calculate three scores: FN-N, FN-O and FN-Total.
An object with the same class as data
contains following values:
fnn |
The overall number of correct face name pairs. |
fno |
The overall number of correct face occupation pairs. |
fntotal |
The overall number of correct face name and occupation pairs. |
Amariglio, R. E., Frishe, K., Olson, L. E., Wadsworth, L. P., Lorius, N., Sperling, R. A., & Rentz, D. M. (2012). Validation of the Face Name Associative Memory Exam in cognitively normal older individuals. Journal of Clinical and Experimental Neuropsychology, 34(6), 580–587. https://doi.org/10.1080/13803395.2012.666230
A classical test on decision making. Read more details on wikipedia. This modified version uses pools to simulate cards, but the essential ideas are the same.
igt(data, .by = NULL, .input = NULL, .extra = NULL)
igt(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
sum_outcome |
The total outcome over all trials. |
perc_good |
The number of choices on "good" pools. |
This test is about visuo-spatial skills. For more details, read this introduction.
jlo(data, .by = NULL, .input = NULL, .extra = NULL)
jlo(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc |
Count of correct responses. |
mean_ang_err |
Mean of the response angle errors. |
mean_log_err |
Mean of the log-transformed (of base 2) response angle errors. |
Several tests are based on subject's spatial acuity, so typically a distance
error is collected and scores are calculated based on that error. locmem()
deal with the distance condition only. locmem2()
deals with a special case
when the response order and distance both matter.
locmem(data, .by = NULL, .input = NULL, .extra = NULL) locmem2(data, .by = NULL, .input = NULL, .extra = NULL)
locmem(data, .by = NULL, .input = NULL, .extra = NULL) locmem2(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc_loc |
Count of correct responses for location. |
mean_dist_err |
Mean of the response distance errors. |
mean_log_err |
Mean of the log-transformed (of base |
nc_order |
Count of correct responses for order. For |
A classical test on problem solving.
london(data, .by = NULL, .input = NULL, .extra = NULL)
london(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
prop_perfect |
Proportion of responses with minimal moves. |
mrt_init |
Mean initial response time. |
There will typically be some speed advantage if there are more than one sensory inputs to be employed. This function calculates this advantage.
multisense(data, .by = NULL, .input = NULL, .extra = NULL)
multisense(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
mrt_image |
Mean reaction time of Image stimuli. |
mrt_sound |
Mean reaction time of Sound stimuli. |
mrt_mixed |
Mean reaction time of Mixed stimuli. |
mrt_mixadv |
Mean reaction decrease of Mixed stimuli compared to other two types of stimuli. |
A classical working memory test.
nback(data, .by = NULL, .input = NULL, .extra = NULL) dualnback(data, .by = NULL, .input = NULL, .extra = NULL)
nback(data, .by = NULL, .input = NULL, .extra = NULL) dualnback(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
Note for dual n-back, the returned indices include those for each modal and both modals so they are tripled with additional suffix after each index name.
An object with the same class as data
contains following values
(tripled for dual n-back):
pc |
Percentage of correct responses. |
mrt |
Mean reaction time. |
ies |
Inverse efficiency score. |
rcs |
Rate correct score. |
lisas |
Linear integrated speed-accuracy score. |
dprime |
Sensitivity index. |
A classical test on subject's numerical estimation skills.
nle(data, .by = NULL, .input = NULL, .extra = NULL)
nle(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
mean_abs_err |
Mean absolute error. |
mean_log_err |
Mean log absolute error. |
A classical test on subject's counting estimation skills.
nsymncmp(data, .by = NULL, .input = NULL, .extra = NULL)
nsymncmp(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
pc |
Percentage of correct responses. |
mrt |
Mean reaction time. |
w |
Weber fraction. |
symncmp()
for symbolic number comparison.
Accepts a data frame containing raw data and calculates performance indices using a user-defined function.
preproc_data( data, fn, ..., col_raw_parsed = "raw_parsed", pivot_results = TRUE, pivot_names_to = "index_name", pivot_values_to = "score" )
preproc_data( data, fn, ..., col_raw_parsed = "raw_parsed", pivot_results = TRUE, pivot_names_to = "index_name", pivot_values_to = "score" )
data |
A data.frame contains raw data. |
fn |
This can be a function or formula. See |
... |
Additional arguments passed to |
col_raw_parsed |
The column name in which stores user's raw data in format of a list of data.frames. |
pivot_results |
Whether to pivot the calculated indices. If |
pivot_names_to , pivot_values_to
|
The column names used to store index
names and values if |
Observations with empty raw data (empty vector, e.g. NULL
, in
col_raw_parsed
column) are removed before calculating indices. If no
observations left after removing, a warning is signaled and NULL
is
returned.
A data.frame contains the calculated indices.
This is a modified version of NeuroRacer game.
racer(data, .by = NULL, .input = NULL, .extra = NULL)
racer(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
mean_score |
Mean overlap score. |
dprime |
Sensitivity index of detection task. |
This test contains two sets, namely set I and set II, and set I is a practice set, whereas set II is the test set. So scores for each set and whole set are calculated here.
rapm(data, .by = NULL, .input = NULL, .extra = NULL)
rapm(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc_prac |
Number of correct items for set I. |
nc_test |
Number of correct items for set II. |
nc_total |
Number of correct items for whole set. |
Typically, two classes of spatial frames of reference: "egocentric" and "allocentric". The spatial acuity for both classes are calculated.
refframe(data, .by = NULL, .input = NULL, .extra = NULL)
refframe(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
mean_dist_err_allo/mean_dist_err_ego |
Mean of the response distance errors for allocentric and egocentric conditions respectively. |
mean_log_err_allo/mean_log_err_ego |
Mean of the log-transformed (of
base |
A classical reinforcement learning test.
reinf(data, .by = NULL, .input = NULL, .extra = NULL)
reinf(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
pc_learn |
The total percent of correct in the learn phase. |
pc_test |
The total percent of correct in the test phase. |
pc_approach |
The percent of correct for approach trials. |
pc_avoid |
The percent of correct for avoid trials. |
Choice Reaction Time (CRT) and Simple Reaction Time (SRT) are classical tests
of human reaction times. These functions calculates the mean and standard
deviation of reaction times. In addition, subjects can commit errors in CRT
tests, so the number of correct responses is also calculated in crt()
.
crt(data, .by = NULL, .input = NULL, .extra = NULL) srt(data, .by = NULL, .input = NULL, .extra = NULL)
crt(data, .by = NULL, .input = NULL, .extra = NULL) srt(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc |
Count of correct responses. Only for |
mrt |
Mean reaction time. |
rtsd |
Standard deviation of reaction times. |
ies |
Inverse efficiency score. Only for |
rcs |
Rate correct score. Only for |
lisas |
Linear integrated speed-accuracy score. Only for |
There is a bunch of tests measuring working memory span or attention span.
span(data, .by = NULL, .input = NULL, .extra = NULL)
span(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
nc |
Count of correct responses. |
max_span |
Maximal span. |
mean_span_pcu |
Mean span using partial credit unit score. |
mean_span_anu |
Mean span using all-or-nothing unit score. |
A very simple method is used here, i.e., averaging all the levels in the last block.
staircase(data, .by = NULL, .input = NULL, .extra = NULL)
staircase(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
This is under the assumption that the last block is stable enough so that an average of the levels is just the convergence of the threshold.
An object with the same class as data
contains following values:
thresh_peak_valley |
The mean threshold of peaks and valleys. |
thresh_last_block |
The mean threshold of the last block. |
A classical test on inhibition skills. The index calculation is now based on https://doi.org/10.7554/eLife.46323.
stopsignal(data, .by = NULL, .input = NULL, .extra = NULL)
stopsignal(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
A tibble with the following variables:
pc_all |
Percent of correct for all the responses. |
pc_go |
Percent of correct for the go trials only. |
pc_stop |
Percent of correct for the stop trials only. |
rt_nth |
Percentile go reaction time (ms) based on |
mean_ssd |
Mean of stop signal delay (ms). |
ssrt |
Stop signal reaction time (ms). |
In task switching paradigms, two types of tasks switch between each other, so
the "switch cost" can be calculated (using switchcost()
). Similarly, in
Stroop-like tasks, stimuli are classified into two conditions (i.e.,
"congruent" and "incongruent"), so the "congruence effect" can be
calculated (using congeff()
). There are also special types of tests where
congruence effect and switch cost both exist, from which complexswitch()
calculates both.
complexswitch(data, .by = NULL, .input = NULL, .extra = NULL) congeff(data, .by = NULL, .input = NULL, .extra = NULL) switchcost(data, .by = NULL, .input = NULL, .extra = NULL)
complexswitch(data, .by = NULL, .input = NULL, .extra = NULL) congeff(data, .by = NULL, .input = NULL, .extra = NULL) switchcost(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
A tibble with the following variables:
For the total task:
pc |
Percent of correct. |
mrt |
Mean reaction time. |
For congruence effect and switch cost, the following indices will be included (including diffs and value for each condition):
pc |
Percent of correct. |
mrt |
Mean reaction time. |
ies |
Inverse efficiency score. |
rcs |
Rate correct score. |
lisas |
Linear integrated speed-accuracy score. |
Several values including percentage of correct responses (pc), mean reaction time (mrt), distance effect (dist_effect) and adjusted distance effect (dist_effect_cor).
symncmp(data, .by = NULL, .input = NULL, .extra = NULL)
symncmp(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
pc |
Percentage of correct responses. |
mrt |
Mean reaction time. |
dist_eff |
Distance effect. |
nsymncmp()
for non-symbolic number comparison.
This is a multi-task game designed by Elsmore (1994).
synwin(data, .by = NULL, .input = NULL, .extra = NULL)
synwin(data, .by = NULL, .input = NULL, .extra = NULL)
data |
Raw data of class |
.by |
The column name(s) in |
.input , .extra
|
Each is a |
An object with the same class as data
contains following values:
score_total |
Total score. Sum of the three sub-tests. |
score_mem |
Score in the memory sub-test. |
score_vis |
Score in visual monitoring sub-test. |
score_aud |
Score in auditory monitoring sub-test. |