clean_iat | R Documentation |
Select IAT blocks for the D-score computation and eventually save demographic data.
clean_iat( data, sbj_id = "participant", block_id = "blockcode", mapA_practice = "practice_MappingA", mapA_test = "test_MappingA", mapB_practice = "practice_MappingB", mapB_test = "test_MappingB", latency_id = "latency", accuracy_id = "correct", trial_id = NULL, trial_eliminate = NULL, demo_id = NULL, trial_demo = NULL )
data |
Dataframe containing IAT data. |
sbj_id |
Column identifying participants' IDs. This variable can be a |
block_id |
String. Column identifying
IAT blocks. The |
mapA_practice |
String. Label for the practice blocks of Mapping A (as
it appears in the |
mapA_test |
String. Label for the test blocks of Mapping A (as
it appears in the |
mapB_practice |
String. Label for the practice blocks of Mapping B (as
it appears in the |
mapB_test |
String. Label for the test blocks of Mapping B (as
it appears in the |
latency_id |
String. Column identifying response times (in millisecond). If the IAT had a built-in correction, latencies of the incorrect responses should be those inflated with the built-in correction. |
accuracy_id |
String. Column identifying the
IAT accuracy responses. The |
trial_id |
Character. Column identifying the trials. Specify this only if you want to delete some specific trials. |
trial_eliminate |
Character or character vector. Label(s) identifying the trials
in |
demo_id |
Character. Column identifying demographic blocks. It can be the same as |
trial_demo |
Character or character vector identifying the name of the
blocks in |
List of dataframe.
data_keep
Dataframe with class iat_clean
. The
dataframe contains the data of the blocks specified in
mapA_practice
, mapA_test
, mapB_practice
,
mapB_test
. If you have specified the trials to eliminate through
trial_eliminate
, data_keep
will contain the already
cleaned dataset. This dataset should be passed to the computeD
function.
data_eliminate
Dataframe containing all the discarded blocks and trials.
data_demo
Dataframe containing demographic variables.
It will be present only if you specified the demo_id
and
trial_demo
arguments.
data("raw_data") # load data iat_cleandata <- clean_iat(raw_data, sbj_id = "Participant", block_id = "blockcode", mapA_practice = "practice.iat.Milkbad", mapA_test = "test.iat.Milkbad", mapB_practice = "practice.iat.Milkgood", mapB_test = "test.iat.Milkgood", latency_id = "latency", accuracy_id = "correct", trial_id = "trialcode", trial_eliminate = c("reminder", "reminder1"), demo_id = "blockcode", trial_demo = "demo") iat_data <- iat_cleandata[[1]] # select the first element of the list (IAT data) head(iat_data) demo_data <- iat_cleandata[[3]] # select the third element of the list # (demographic data) head(demo_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.