ch.filterOverlapsByQuantile: A function to filters the choice data by value overlaps using...

ch.filterOverlapsByQuantileR Documentation

A function to filters the choice data by value overlaps using quantiles rather than fixed values.

Description

This function filters the choice data for analysis by removing RT outliers and bad subjects based on RT and p(HVO) using quantiles rather than fixed values.

Usage

ch.filterOverlapsByQuantile(
  data,
  snCol,
  RTcol,
  overlapRoundCol,
  correctCol,
  correctVals = c(TRUE, FALSE),
  chanceThreshold = 1,
  lowRTquantileThreshold = 0,
  highRTquantileThreshold = 1,
  minOverlapN = 0,
  statsOutputFile = NULL
)

Arguments

data

A dataframe containing the choice RT data. (typically after running through ch.moralsDataPrep()).

snCol

A string that specifies the name of the column in "data" that contains the subject number.

RTcol

A string that specifies the name of the column in "data" that contains the RT for each trial.

overlapRoundCol

A string that specifies the name of the column in "data" that contains the rounded overlaps for the item in each trial. Column created in ch.moralsDataPrep() via ch.mergeChoiceDataWithOverlapsData().

correctCol

A string that specifies the name of the new column that will contains an indication of whether or not the response was correct.

correctVals

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

chanceThreshold

A number specifying the quantile that all subjects whose p(HVO) falls below it will be removed from the dataset. DEFAULT = 0 (none removed)

lowRTquantileThreshold

A number specifying the quantile that, for each overlapRound, individual RTs that fall below it will be removed from the dataset. DEFAULT = 0.0 (none removed)

highRTquantileThreshold

A number specifying the quantile that, for each overlapRound, individual RTs that fall above it will be removed from the dataset. DEFAULT = 1.0 (none removed)

minOverlapN

A number specifying the minimum number of responses an overlapRound condition must have to remain in the dataset. DEFAULT = 0 (none removed)

statsOutputFile

the filename that you want the statistics summary output written to. DEFAULT = NULL (no file written)

Value

a dataframe of filtered data.

Examples

ch.filterOverlapsByQuantile (data=moralsData, "sn", "RT", "overlapRound", "avePred", correctVals = c(TRUE, FALSE), chanceThreshold = 0.5, lowRTquantileThreshold = 0.025, highRTquantileThreshold = 0.975, minOverlapN = 40)

ccpluncw/ccpl_R_chMorals documentation built on Feb. 4, 2024, 3:30 p.m.