get_bs: Mean bias score

Description Usage Arguments Details Value See Also Examples

View source: R/get_bs.R

Description

get_bs returns the mean difference between congruent and incongruent trials.

Usage

1
get_bs(RT, congruent, prior_weights = NULL)

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 mean bias, in the event that there is reason to weight some trials more than others when calculating their mean.

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. get_bs calculates a traditional bias score 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, with the option to use weighted means based on prior trial weights.

Value

A length-one numeric vector corresponding to the mean, or optionally weighted mean, bias score.

See Also

get_tlbs for trial-level bias score

Examples

1
2
3
4
5
6
7
# Create example time series of 10 reaction times in ms:
rt <- sample(100:1000, 10)

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

get_bs(rt, congruent)

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