Description Usage Arguments Details Value References See Also Examples
get_tlbs
calculates the trial-level bias score (TL-BS) as described by
Zvielli et al. (2015).
1 2 3 4 5 6 7 8 |
RT |
A numeric vector of reaction times in chronological order. |
congruent |
A logical vector equal in length to |
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 " |
search_limit |
If using |
fill_gaps |
Logical indicating whether missing values in the TLBS time
series should be imputed based on neighboring trials. Default is
|
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.
A vector of trial-level bias scores.
Zvielli A, Bernstein A, Koster EHW. 2015. Temporal dynamics of attentional bias. Clinical Psychological Science. 3(5):772-788.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.