get_tlbs: Trial-level Bias Score

Description Usage Arguments Details Value References See Also Examples

View source: R/get_tlbs.R

Description

get_tlbs calculates the trial-level bias score (TL-BS) as described by Zvielli et al. (2015).

Usage

1
2
3
4
5
6
7
8
get_tlbs(
  RT,
  congruent,
  prior_weights = NULL,
  method = "weighted",
  search_limit = 5,
  fill_gaps = FALSE
)

Arguments

RT

A numeric vector of reaction times in chronological order.

congruent

A logical vector equal in length to RT that indicates whether the corresponding entry of RT is a congruent (TRUE) or incongruent (FALSE) trial, i.e., whether the probe location matches the location of the stimulus expected to elicit attention bias.

prior_weights

Optional numeric vector of prior weights indicating the relative influence that each trial should have on the calculation of TLBS and summary metrics. If not provided, all trials are assumed to carry equal weight.

method

String indicating method to be used to calculate TLBS. The default method "weighted" compares each trial to the distance-weighted mean of all trials of opposite type. If method = "nearest", the method described by Zvielli et al. (2015) is implemented, and each trial is compared to the single nearest trial of opposite type. See Details.

search_limit

If using weighted = FALSE, an integer indicating how many trials to look forward or backward to find a trial of opposite type. Default value is 5. If no match is found within the search_limit of a trial, NA will be returned for that trial.

fill_gaps

Logical indicating whether missing values in the TLBS time series should be imputed based on neighboring trials. Default is FALSE.

Details

Attention bias tasks such as the dot probe consist of congruent trials (CTs), in which the location of the probe matches the location of an emotional stimulus, and incongruent trials (ITs), in which the location of the probe matches the location of the neutral stimulus. Traditionally, a bias score is computed by taking the mean reaction time of all CTs and subtracting it from the mean reaction time of all ITs, i.e., bias = IT - CT. Zvielli et al. (2015) proposed a trial-level bias score (TL-BS), which computes a bias score for every trial by comparing it to the most temporally proximal trial of opposite type. If the method argument is set to "nearest", get_tlbs implements this nearest-trial method of calculating TL-BS. By default (method = "weighted") get_tlbs uses an alternative weighted-trials method that calculates the weighted mean of all trials of opposite type, with closer trials weighted more heavily than more distant trials (as a function of the inverse square of trial distance.) To calculate TLBS, each CT is subtracted from the weighted mean of all ITs, and the weighted mean of all CTs is subtracted from each IT.

The two methods yield highly similar TL-BS numbers, but the weighted method may be preferable for two reasons: 1) In the event that a trial of one type is equidistant from two trials of opposite type, the nearest-trial method arbitrarily chooses one over the other; under this circumstance, the mean of the two trials may be a more valid point of comparison. 2) The nearest-trial method frequently double-counts the same IT-CT subtraction. For example, consider the sequence IT IT CT CT: under the nearest-trial method, the interior IT-CT pair will result in duplicate TL-BS calculations for these two trials. This double counting results in brief but frequent artifactual periods where the TL-BS time series is completely flat. (See examples below.) Under the weighted method, these calculations will be non-identical because a trial is not subtracted directly from another single trial, but rather from uniquely weighted means of all trial pairs.

Value

A vector of trial-level bias scores.

References

Zvielli A, Bernstein A, Koster EHW. 2015. Temporal dynamics of attentional bias. Clinical Psychological Science. 3(5):772-788.

See Also

summarize_bias, get_bs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Create example time series of 50 reaction times in ms:
trial <- 1:25
set.seed(1)
rt <- sample(100:1000, 25)

# Create example trial types of congruent vs. incongruent for above measures:
congruent <- sample(c(TRUE,FALSE), 25, replace = TRUE)

# Calculate TL-BS using the default weighted-mean method:
weighted <- get_tlbs(RT = rt, congruent = congruent)

# Calculate TL-BS using the nearest-trial method:
unweighted <- get_tlbs(RT = rt, congruent = congruent, method = "nearest")

# Note how the nearest-trial method results in intermittent plateaus because
# of duplicated subtractions:
par(mfrow = c(2,1))
plot(trial, weighted, type = "l",
     main = "Weighted-trials method")
plot(trial, unweighted, type = "l",
     main = "Nearest-trial method")

jashu/itrak documentation built on May 9, 2020, 1:57 p.m.