multi_dscore: Compute and plot multiple D-scores

View source: R/multi_dscore.R

multi_dscoreR Documentation

Compute and plot multiple D-scores

Description

Compute and plot multiple D-scores.

Usage

multi_dscore(data, ds = c("built-in", "error-inflation"))

Arguments

data

Dataframe of class iat_clean.

ds

String. Indicates which D-score to compute. built-in compute only D-score with the built-in error correction (D1 and D2), error-inflation compute the D-scores without built-in correction (D3 to D6).

Value

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

Examples


 # 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
  

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