nonRecursive: nonRecursive trimming procedure.

View source: R/nonRecursive.R

nonRecursiveR Documentation

nonRecursive trimming procedure.

Description

nonRecursive takes a data frame of RT data and returns trimmed rt data that fall below a set standard deviation above the each participant's mean for each condition. The SD used for trimming is proportional to the number of trials in the data being passed, as described in van Selst & Jolicoeur (1994).

Usage

nonRecursive(
  data,
  minRT,
  pptVar = "participant",
  condVar = "condition",
  rtVar = "rt",
  accVar = "accuracy",
  omitErrors = TRUE,
  returnType = "mean",
  digits = 3
)

Arguments

data

A data frame with columns containing: participant identification number ('pptVar'); condition identification, if applicable ('condVar'); response time data ('rtVar'); and accuracy ('accVar'). The RT can be in seconds (e.g., 0.654) or milliseconds (e.g., 654). Typically, "condition" will consist of strings. Accuracy must be coded as 1 for correct and 0 for error responses.

minRT

The lower criteria for acceptable response time. Must be in the same form as rt column in data frame (e.g., in seconds OR milliseconds). All RTs below this value are removed before proceeding with SD trimming.

pptVar

The quoted name of the column in the data that identifies participants.

condVar

The quoted name of the column in the data that includes the conditions.

rtVar

The quoted name of the column in the data containing reaction times.

accVar

The quoted name of the column in the data containing accuracy, coded as 0 or 1 for incorrect and correct trial, respectively.

omitErrors

If set to TRUE, error trials will be removed before conducting trimming procedure. Final data returned will not be influenced by errors in this case.

returnType

Request nature of returned data. "raw" returns trial- level data excluding trimmed data; "mean" returns mean response times per participant for each experimental condition identified; "median" returns median response times per participant for each experimental condition identified.

digits

How many decimal places to round to after trimming?

References

Van Selst, M. & Jolicoeur, P. (1994). A solution to the effect of sample size on outlier elimination. Quarterly Journal of Experimental Psychology, 47 (A), 631-650.

Examples

# load the example data that ships with trimr
data(exampleData)

# perform the trimming, returning mean RT
trimmedData <- nonRecursive(data = exampleData, minRT = 150,
returnType = "mean")


trimr documentation built on May 5, 2022, 9:05 a.m.