tef_acc2dprime: Convert an ordered vector of accuracies to d-prime

View source: R/tef_acc2dprime.R

tef_acc2dprimeR Documentation

Convert an ordered vector of accuracies to d-prime

Description

Given paired information regarding accuracy and stimulus presence, run a Gaussian-weighted-mean smoother [kernel] over the accuracy vector separately for stimulus-present and stimulus-absent indices, then compute an index-wise d-prime. Returning and entire-vector d-prime (i.e., stable across time) is also an option.

Usage

tef_acc2dprime(
  accuracy,
  stim_present,
  by_index = T,
  trial_hwhm = 3,
  max_dprime = 5
)

Arguments

accuracy

At each index, what was the accuracy: [bounded at 0 and 1]

stim_present

At each index, was the stimulus present or absent: [binary; 0 and 1, or logical]

by_index

Should the d-prime be calculated for each index?

trial_hwhm

The Gaussian smoother has a half-width-half-max; values are given half weight at this index distance from the center index (as the smoother iterates through each index in turn as the center). An arbitrarily small HWHM will lead to the same behavior as linear interpolation.

max_dprime

d-prime becomes infinite as accuracy approaches 0 or 1. This value limits the absolute value of d-prime.


akcochrane/TEfits documentation built on June 12, 2025, 11:10 a.m.