ch.calculateDprimeStats: A function to calculate D Prime statistics

ch.calculateDprimeStatsR Documentation

A function to calculate D Prime statistics

Description

This function calculated D Prime statistics.

Usage

ch.calculateDprimeStats(
  data,
  grpCols,
  correctCol,
  correctVals = c(TRUE, FALSE),
  targetPresentCol,
  targetPresentVals = c(TRUE, FALSE),
  addCorrection = TRUE
)

Arguments

data

a dataframe with the trial by trial responses.

grpCols

a vector containing strings that specifies the names of the columns in "data" that you want the data grouped by.

correctCol

a string that specifies the name of the column in "data" that contains the whether or not the participant responded correctly.

correctVals

a vector of two values that specifies the "correct" value (index 1) and the "incorrect" value (index 2). e.g, c("yes", "no")

targetPresentCol

a string that specifies the name of the column in "data" that contains the whether or not the target was presented.

targetPresentVals

a vector of two values that specifies the "target present" value (index 1) and the "target absent" value (index 2). e.g, c("yes", "no")

addCorrection

a boolean that specifies whether you want a .5 correction to be added the total hits, FAs, misses, and CRs. This corrects for 0 and 1 values for FA and Hits. DEFAULT = T.

Value

dataframe with the dprime statistics:

Examples

ch.calculateDprimeStats (data=moralsData,"sn", "trial", "RT", "res.RT", "fit.RT", "overlap", "keyDef", c("Yes", "No"), "correct", params=parameters)

ccpluncw/ccpl_R_chutils documentation built on Feb. 28, 2024, 1:17 a.m.