multi_dsciat: Plot SC-IATs scores

Description Usage Arguments Value Examples

View source: R/multi_dsciat.R

Description

Plot the scores from two different SC-IATs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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
)

Arguments

sciat1

Dataframe with class dsciat. Contains the D for the first SC-IAT.

sciat2

Dataframe with class dsciat. Contains the D for the second SC-IAT.

graph

String. Type of graph to display. Default is density.

x_values

Logical. Shows the values for x-axis (default = TRUE). Only for the point graph.

gcolors

String. Colors palette for plotting the results. Default is dark.

label_sc1

String. Label to display in the graph for the first SC-IAT. Default is SC-IAT1.

label_sc2

String. Label to display in the graph for the first SC-IAT. Default is SC-IAT2.

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.

Value

A ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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

OttaviaE/implicitMeasures documentation built on Feb. 22, 2022, 2:05 p.m.