trim_rt_trials_sd: Trim trials from ACE/SEA data by response time within N SDs...

View source: R/module-trim.R

trim_rt_trials_sdR Documentation

Trim trials from ACE/SEA data by response time within N SDs of the mean

Description

Applies corresponding ace_trims to every session of data. If trimming is to be done by range and by SD, we recommend calling trim_rt_trials_range first, and then calling this function to trim by SD.

Usage

trim_rt_trials_sd(
  df,
  cutoff = 3,
  exclude = c("SAAT", "SAATIMPULSIVE", "SAATSUSTAINED"),
  verbose = TRUE
)

Arguments

df

a data.frame containing formatted trialwise ACE data.

This includes data loaded with the following methods:

  1. load_ace_file

  2. load_ace_bulk

cutoff

numeric. Remove within-subject RTs further than this many SD from within-subject mean RT? Enter as one number. Defaults to 3.

exclude

character vector. Specify the names of modules (proper naming convention!) that should be ignored. Defaults to all "SAAT" data, but can be specified as an empty character vector (in which case the SAAT module's RTs would be subject to SD scrubbing). Note that this function always excludes spatial span tasks, as those are much shorter than other modules.

verbose

logical. Print details? Defaults to TRUE.

Value

Returns the input data, with RTs corresponding to offending trials rendered as NA.

Assumptions

Assumes the data.frame is nested, with two columns: module (character) and data (list, each containing a data.frame).


josegallegos07/aceR documentation built on June 27, 2022, 10:25 a.m.