Title: | Compute Scores for Different Implicit Measures |
---|---|
Description: | A tool for computing the scores for the Implicit Association Test (IAT; Greenwald, McGhee & Schwartz (1998) <doi:10.1037/0022-3514.74.6.1464>) and the Single Category-IAT (SC-IAT: Karpinski & Steinman (2006) <doi:10.1037/0022-3514.91.1.16>). Functions for preparing the data (both for the IAT and the SC-IAT), plotting the results, and obtaining a table with the scores of implicit measures descriptive statistics are provided. |
Authors: | Ottavia M. Epifania [aut, cre], Pasquale Anselmi [ctb], Egidio Robusto [ctb] |
Maintainer: | Ottavia M. Epifania <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.1 |
Built: | 2025-02-05 03:25:33 UTC |
Source: | https://github.com/ottaviae/implicitmeasures |
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 )
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)
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)
Select the SC-IAT blocks, for either one or two SC-IATs. Eventually save demographic data.
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 )
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 )
data |
Dataframe containing SC-IAT data. |
sbj_id |
Column identifying participants' IDs. This variable can be a |
block_id |
String. Column identifying
SC-IAT blocks. The |
accuracy_id |
String. Column identifying the
IAT accuracy responses. The |
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_sciat_2 |
Character or character vector. Labels identifying the second (if present) SC-IAT
blocks as they are named in the |
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 |
demo_id |
Character. 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.
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.
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]]
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]]
Compute D-score for the IAT according to different algorithms.
compute_iat(data, Dscore = c("d1", "d2", "d3", "d4", "d5", "d6"))
compute_iat(data, Dscore = c("d1", "d2", "d3", "d4", "d5", "d6"))
data |
Dataframe with class |
Dscore |
Character. Indicates which D-score to compute. For details on the algorithms, please refer to Greenwald et al. (2003). |
Dataframe with class "dscore"
. The number of rows of the
dataframe corresponds to the total number of participants.
Variables are defined as follows (the values are specific for each
participant):
participant
Respondents' IDs.
n_trial
Number of trails before data cleaning.
nslow10000
Number of slow trials (> 10,000 ms).
nfast400
Number of fast trials (< 400 ms).
nfast300
Number of fast trials (< 300 ms).
accuracy.practice_MappingA
Proportion of correct responses in practice block of Mapping A.
accuracy.practice_MappingB
Proportion of correct responses in practice block of Mapping B.
accuracy.test_MappingA
Proportion of correct responses in test block of Mapping A.
accuracy.test_MappingB
Proportion of correct responses in test block of Mapping B.
accuracy.MappingA
Proportion of correct responses in Mapping A.
accuracy.MappingB
Proportion of correct responses in Mapping B.
RT_mean.MappingA
Mean response time in Mapping A.
RT_mean.MappingB
Mean response time in Mapping B.
mean_practice_MappingA
Mean response time in practice block of Mapping A.
mean_practice_MappingB
Mean response time in practice block of Mapping B.
mean_test_MappingA
Mean response time in test block of Mapping A.
mean_test_MappingB
Mean response time in test block of Mapping B.
d_practice_dX
D-scores compute_iat on the practice blocks. The X stands for the selected D-score procedure.
d_test_dX
D-scores compute_iat on the test blocks. The X stands for the selected D-score procedure.
dscore_dX
The average D-score for the practice and test D-scores. The X stands for the selected D-score procedure.
cond_ord
Indicates the order with which the associative
conditions have been presented, either "MappingA_First"
or
"MappingB_First"
.
legendMappingA
Indicates the corresponding value of Mapping A in the original dataset.
legendMappingB
Indicates the corresponding value of Mapping B in the original dataset.
# compute D-score 2 for the IAT data ### data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2")
# compute D-score 2 for the IAT data ### data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2")
Compute the D-score for the SC-IAT.
compute_sciat( data, mappingA = "mappingA", mappingB = "mappingB", non_response = NULL )
compute_sciat( data, mappingA = "mappingA", mappingB = "mappingB", non_response = NULL )
data |
Data frame with class |
mappingA |
String. Label identifying the mapping A of the SC-IAT in the
|
mappingB |
String. Label identifying the mapping B of the SC-IAT in the
|
non_response |
String. Labels of the trials identifying the
non-responses, a.k.a responses beyond the response time
window, as it was specified in |
A dataframe with class compute_sciat
. The number of rows of the
dataframe corresponds to the total number of participants. Variables
are defined as follows (the values are specific for each
participant):
participant
Respondents' IDs.
n_trial
Number of trial before data cleaning.
no_response
If there were any trials identifying the non
response, it indicates the number of non responses per each
participant. Otherwise, it is equal for all participants
("none"
).
nslow10000
Number of slow trials (> 10,000 ms).
out_accuracy
Indicates whether the participants had more
than 25 % of incorrect responses in at least one of the
critical blocks and hence should be eliminated ("out"
)
or not ("keep"
).
nfast400
Number of fast trials (< 400 ms).
nfast300
Number of fast trials (< 350 ms – deleted).
accuracy.mappingA
Proportion of correct responses in Mapping A.
accuracy.mappingB
Proportion of correct responses in mapping B.
RT_mean.MappingA
Mean response time in Mapping A.
RT_mean.MappingB
Mean response time in Mapping B.
cond_ord
Indicates the order with which the associative
conditions have been presented, either "MappingA_First"
or
"MappingB_First"
.
legendMappingA
Indicates the corresponding value of Mapping A in the original dataset.
legendMappingB
Indicates the corresponding value of Mapping B in the original dataset.
d_sciat
SC-IAT D.
# calculate D for the SCIAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") head(d_sciat1) # dataframe containing the SC-IAT D of the of the # first SC-IAT sciat2 <- sciat_data[[2]] # Compute D for the second SC-IAT d_sciat2 <- compute_sciat(sciat2, mappingA = "test.sc_milk.Milkbad", mappingB = "test.sc_milk.Milkgood", non_response = "alert") head(d_sciat2)
# calculate D for the SCIAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") head(d_sciat1) # dataframe containing the SC-IAT D of the of the # first SC-IAT sciat2 <- sciat_data[[2]] # Compute D for the second SC-IAT d_sciat2 <- compute_sciat(sciat2, mappingA = "test.sc_milk.Milkbad", mappingB = "test.sc_milk.Milkgood", non_response = "alert") head(d_sciat2)
Plot the distribution of the IAT D-score or the SC-IAT D.
d_density( data, graph = c("histogram", "density", "violin"), n_bin = 80, col_fill = "royalblue", col_point = "red", include_stats = FALSE )
d_density( data, graph = c("histogram", "density", "violin"), n_bin = 80, col_fill = "royalblue", col_point = "red", include_stats = FALSE )
data |
Dataframe with either class |
graph |
String. Indicates the graphs to display. Default is
|
n_bin |
Numeric. Indicates the number of bins to display. |
col_fill |
String. Indicates the color for filling the bars of the
|
col_point |
String. Indicates the color for the individual scores –each
point – in the violin plot. Default is |
include_stats |
Logical. Indicates whether to add descriptive statistics.
The |
A ggplot object.
# Plotting the IAT D-score data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") d_density(iat_dscore) # Default graph d_density(iat_dscore, graph = "histogram", n_bin = 30) # Histogram with a different number of bins d_density(iat_dscore, graph = "density") # IAT D-score density plot d_density(iat_dscore, graph = "violin") # IAT D-score violin plot # Plot the SC-IAT D for the first SC-IAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") d_density(d_sciat1, graph = "histogram", include_stats = TRUE) # SC-IAT D histogram with descriptive # statistics
# Plotting the IAT D-score data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") d_density(iat_dscore) # Default graph d_density(iat_dscore, graph = "histogram", n_bin = 30) # Histogram with a different number of bins d_density(iat_dscore, graph = "density") # IAT D-score density plot d_density(iat_dscore, graph = "violin") # IAT D-score violin plot # Plot the SC-IAT D for the first SC-IAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") d_density(d_sciat1, graph = "histogram", include_stats = TRUE) # SC-IAT D histogram with descriptive # statistics
Plot the individual D-score or SC-IAT D.
d_point( data, point_size = 1, x_label = "Participant", x_values = TRUE, order_sbj = c("default", "D-increasing", "D-decreasing"), col_point = "springgreen4", include_stats = FALSE )
d_point( data, point_size = 1, x_label = "Participant", x_values = TRUE, order_sbj = c("default", "D-increasing", "D-decreasing"), col_point = "springgreen4", include_stats = FALSE )
data |
Dataframe with either class |
point_size |
Numeric. Indicates the size of the points in the graph. Default is 1. |
x_label |
Character. Label of the x-axis. Default is |
x_values |
Logical. Shows the values for x-axis (default = |
order_sbj |
Character. Defines the order with which the participants are displayed. Default is the default order of participants in the dataframe. |
col_point |
Character. Defines the color of the points. Default is
|
include_stats |
Logical. Indicates whether to add descriptive statistics.
The |
A ggplot object
# Plotting the IAT D-score data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") d_point(iat_dscore) # default plot d_point(iat_dscore, order_sbj = "D-increasing") # D-score with increasing # order d_point(iat_dscore, order_sbj = "D-decreasing", col_point = "salmon") # D-score with decreasing order changed color # Plot the SC-IAT D for the first SC-IAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") d_point(d_sciat1, col_point = "salmon", include_stats = TRUE) # SC-IAT D with descriptive statistics
# Plotting the IAT D-score data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") d_point(iat_dscore) # default plot d_point(iat_dscore, order_sbj = "D-increasing") # D-score with increasing # order d_point(iat_dscore, order_sbj = "D-decreasing", col_point = "salmon") # D-score with decreasing order changed color # Plot the SC-IAT D for the first SC-IAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") d_point(d_sciat1, col_point = "salmon", include_stats = TRUE) # SC-IAT D with descriptive statistics
Descriptive statistics for the IAT D-score or the SC-IAT D.
descript_d(data, latex = FALSE)
descript_d(data, latex = FALSE)
data |
Dataframe with either class |
latex |
Logical. If |
Dataframe, containing the mean, s.d., minimum and maximum of the IAT
(D-score
, D-practice
, and D-test
) or the SC-IAT
(D-Sciat
, RT.MappingA
, RT.MappingB
).
# compute D-score 2 for the IAT data ### data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") descript_d(iat_dscore) # descriptive statistics for the IAT # calculate D for the SCIAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") descript_d(d_sciat1, latex = TRUE) # descriptive statistics for the SC-IAT in latex # format
# compute D-score 2 for the IAT data ### data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") descript_d(iat_dscore) # descriptive statistics for the IAT # calculate D for the SCIAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") descript_d(d_sciat1, latex = TRUE) # descriptive statistics for the SC-IAT in latex # format
A data set containing the results of the computation of the D-score on the
Dark SC-IAT data set. This data set is used for testing the replicability of the
results obtained with the compute_sciat()
functions.
data("dsciat1")
data("dsciat1")
A dataframe with 15 variables, as those described in the documentation for the
compute_sciat()
function.
A data set containing the results of the computation of the D-score on the
Dark SC-IAT data set. This data set is used for testing the replicability of the
results obtained with the compute_sciat()
functions.
data("dsciat2")
data("dsciat2")
A dataframe with 15 variables, as those described in the documentation for the
compute_sciat()
function.
Compute the practice – test IAT reliability.
IAT_rel(data)
IAT_rel(data)
data |
dataframe with class |
List of two objects:
Test-practice reliability
contains the IAT reliability.
Number of Participants
Contains the number of participants on which the reliability was computed.
# compute D-score 2 for the IAT data ### data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") IAT_rel(iat_dscore)
# compute D-score 2 for the IAT data ### data("raw_data") # import 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]] # calculate D-score iat_dscore <- compute_iat(iat_data, Dscore = "d2") IAT_rel(iat_dscore)
A data set containing the results for all the possible D-score algorithms for the
IAT. All the algorithms are identified by their corresponding label (such
as "dscore_d1"). This data set is used for testing the replicability of
the results of the compute_iat()
function over time.
data("iatdscores")
data("iatdscores")
A dataframe with 7 variables, the first one contains the respondents' id, the other 6 columns contain a specific D-score algorithm.
Plot the scores from two different SC-IATs.
multi_dsciat( sciat1, sciat2, graph = c("density", "violin", "point"), x_values = TRUE, gcolors = c("dark", "greens", "blues", "pinks"), label_sc1 = "SC-IAT1", label_sc2 = "SC-IAT2", label_y = "SC-IAT scores", dens_mean = TRUE )
multi_dsciat( sciat1, sciat2, graph = c("density", "violin", "point"), x_values = TRUE, gcolors = c("dark", "greens", "blues", "pinks"), label_sc1 = "SC-IAT1", label_sc2 = "SC-IAT2", label_y = "SC-IAT scores", dens_mean = TRUE )
sciat1 |
Dataframe with class |
sciat2 |
Dataframe with class |
graph |
String. Type of graph to display. Default is |
x_values |
Logical. Shows the values for x-axis (default = |
gcolors |
String. Colors palette for plotting the results. Default is |
label_sc1 |
String. Label to display in the graph for the first SC-IAT.
Default is |
label_sc2 |
String. Label to display in the graph for the first SC-IAT.
Default is |
label_y |
String. Label to plot on the y-axis. |
dens_mean |
Logical. Whether to include the mean in the density plot. Default is TRUE. |
A ggplot object
# calculate D for the SCIAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") # dataframe with the first D # SC-IAT sciat2 <- sciat_data[[2]] # Compute D for the second SC-IAT d_sciat2 <- compute_sciat(sciat2, mappingA = "test.sc_milk.Milkbad", mappingB = "test.sc_milk.Milkgood", non_response = "alert") # dataframe with the first # D SC-IAT multi_dsciat(d_sciat1, d_sciat2) # plot the D of two SC-IATs with default # settings
# calculate D for the SCIAT data("raw_data") # load 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]] # compute D for the first SC-IAT d_sciat1 <- compute_sciat(sciat1, mappingA = "test.sc_dark.Darkbad", mappingB = "test.sc_dark.Darkgood", non_response = "alert") # dataframe with the first D # SC-IAT sciat2 <- sciat_data[[2]] # Compute D for the second SC-IAT d_sciat2 <- compute_sciat(sciat2, mappingA = "test.sc_milk.Milkbad", mappingB = "test.sc_milk.Milkgood", non_response = "alert") # dataframe with the first # D SC-IAT multi_dsciat(d_sciat1, d_sciat2) # plot the D of two SC-IATs with default # settings
Compute and plot multiple D-scores.
multi_dscore(data, ds = c("built-in", "error-inflation"))
multi_dscore(data, ds = c("built-in", "error-inflation"))
data |
Dataframe of class |
ds |
String. Indicates which D-score to compute. |
A list. The first object is a dataframe containing all the computed
Dscores. The second object is a ggplot
object, depicting the
distribution of the D-scores through violin plots.
@import tidyr
# Compute multiple IAT D-scores data("raw_data") # import 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]] # compute the mulitple scores and prepare the graphs for the built-in # strategies multiple_scores <- multi_dscore(iat_data, ds = "built-in") data_multiple <- multiple_scores$dscores # store the D-score in a dataframe # plot the results multiple_scores$graph
# Compute multiple IAT D-scores data("raw_data") # import 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]] # compute the mulitple scores and prepare the graphs for the built-in # strategies multiple_scores <- multi_dscore(iat_data, ds = "built-in") data_multiple <- multiple_scores$dscores # store the D-score in a dataframe # plot the results multiple_scores$graph
A dataset containing the data from 152 participants who completed one IAT and two SC-IATs. The object of both the implicit measures was chocolate, either Milk or Dark chocolate:
data(raw_data)
data(raw_data)
A dataframe with 6 variables, as follows:
Participant. Participants ID.
latency. Latency of the response times in millisecond.
correct. Response accuracy (0–correct, 1–error).
trialcode. Factor with 32 levels identifying the trial for each response, both for the implicit measures and the demographic questionnaire. It contains also the trials that have to be eliminated, defined as follows:
alert. Defines the SC-IAT trials beyond the response time window.
Reminder, Reminder1. Identify the instruction page.
blockcode. Factor with 13 levels as follow:
practice.iat.Milkbad. IAT practice blocks, Mapping A.
practice.iat.Milkbad. IAT practice blocks, Mapping B.
practice.sc_dark.Darkbad. Dark SC-IAT practice blocks, Mapping A.
practice.sc_dark.Darkbad. Dark SC-IAT practice blocks, Mapping B.
practice.sc_milk.Milkbad. Milk SC-IAT practice blocks, Mapping A.
practice.sc_milk.Milkgood. Milk SC-IAT practice blocks, Mapping B.
test.iat.Milkbad. IAT test blocks, Mapping A.
test.iat.Milkgood. IAT test blocks, Mapping B.
test.sc_dark.Darkbad. Dark SC_IAT test blocks, Mapping A.
test.sc_dark.Darkbad. Dark SC-IAT test blocks, Mapping B.
test.sc_milk.Milkbad. Milk SC-IAT test blocks, Mapping A.
test.sc_milk.Milkgood. Milk SC-IAT test blocks, Mapping B.
demo. Demographic questionnaire.
response. Character registering the type of response for the demographic .