clean_sciat: Prepare and clean SC-IAT data

View source: R/clean_sciat.R

clean_sciatR Documentation

Prepare and clean SC-IAT data

Description

Select the SC-IAT blocks, for either one or two SC-IATs. Eventually save demographic data.

Usage

clean_sciat(
  data,
  sbj_id = "participant",
  block_id = "blockcode",
  accuracy_id = "correct",
  latency_id = "latency",
  block_sciat_1 = NULL,
  block_sciat_2 = NULL,
  trial_id = NULL,
  trial_eliminate = NULL,
  demo_id = NULL,
  trial_demo = NULL
)

Arguments

data

Dataframe containing SC-IAT data.

sbj_id

Column identifying participants' IDs. This variable can be a character, numeric, or factor.

block_id

String. Column identifying SC-IAT blocks. The block_id variable should be a factor with each level identifying a SC-IAT block.

accuracy_id

String. Column identifying the IAT accuracy responses. The accuracy_id variable should be a numeric variable identifying the correct responses (with 1) and the incorrect responses (with 0).

latency_id

String. Column identifying response times (in millisecond).

block_sciat_1

Character or character vector. Labels identifying the first SC-IAT blocks as they are named in the block_id.

block_sciat_2

Character or character vector. Labels identifying the second (if present) SC-IAT blocks as they are named in the block_id.

trial_id

Character. Column identifying the trials. Specify this only if you want to delete some specific trials. If a response window was used for the SC-IAT administration the label of the non-response must be included in this variable.

trial_eliminate

Character or character vector. Labels of the trials to eliminate in the trial_id to eliminate (NOTE: don't use this command to delete the responses exceeding the response time window).

demo_id

Character. Character. Column identifying demographic blocks. It can be the same as block_id.

trial_demo

Character or character vector identifying the name of the blocks in demo_id containing the demographic information.

Value

List of dataframe.

sciat1

Data frame with class sciat_clean containing the data of the first SC-IAT as specified block_sciat_1. If any labels was specified in trial_eliminate, data_keep will contain the already cleaned dataset.

sciat2

Data frame with class sciat_clean containing the data of the second (if any) SC-IAT as specified through block_sciat_2. If any labels was specified in trial_eliminate, data_keep will contain the already cleaned dataset.

data_demo

Data frame. Present only when variable_demo and trial_demo arguments are specified.

Examples

data("raw_data")
sciat_data <- clean_sciat(raw_data, sbj_id = "Participant",
                         block_id = "blockcode",
                         latency_id = "latency",
                         accuracy_id = "correct",
                         block_sciat_1 = c("test.sc_dark.Darkbad",
                                           "test.sc_dark.Darkgood"),
                         block_sciat_2 = c("test.sc_milk.Milkbad",
                                           "test.sc_milk.Milkgood"),
                         trial_id  = "trialcode",
                         trial_eliminate = c("reminder",
                                             "reminder1"))
sciat1 <- sciat_data[[1]]
sciat2 <- sciat_data[[2]]

implicitMeasures documentation built on March 18, 2022, 5:17 p.m.