/
README.Rmd
89 lines (61 loc) · 2.79 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
output:
md_document:
variant: markdown_github
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![](http://www.r-pkg.org/badges/version/trimr)](https://cran.r-project.org/web/packages/trimr/index.html)
[![](http://cranlogs.r-pkg.org/badges/grand-total/trimr)](https://cran.r-project.org/web/packages/trimr/index.html)
# trimr: Response Time Trimming in R
For a detailed overview of how to use *trimr*, please see the vignettes.
## Installation
A stable release of *trimr* [is available on CRAN](https://CRAN.R-project.org/package=trimr). To install this, use:
```{r, eval = FALSE}
install.packages("trimr")
```
You can also install the latest developmental version of *trimr*. Please note, though, that this version is undergoing testing and potentially has unidentified bugs. (If you do use this version and note a bug, [please log it as an issue](https://github.com/JimGrange/trimr/issues)). To install the developmental version, you will first need to install the *devtools* package and install *trimr* directly from GitHub by using the following commands:
```{r, eval = FALSE}
# install devtools
install.packages("devtools")
# install trimr from GitHub
devtools::install_github("JimGrange/trimr")
```
## Overview
*trimr* is an R package that implements most commonly-used response time trimming methods, allowing the user to go from a raw data file to a finalised data file ready for inferential statistical analysis.
The trimming functions available in *trimr* fall broadly into three families:
1. **Absolute Value Criterion**
1. **Standard Deviation Criterion**
1. **Recursive / Moving Criterion**
The latter implements the methods first suggsted by Van Selst & Jolicoeur (1994).
## Example
In the example below, we go from a data frame containing data from 32 participants (in total, 20,518 trials) to a trimmed data set showing the mean trimmed RT for each experimental condition & participant using the modified recursive trimming procedure of Van Selst & Jolicoeur (1994):
```{r}
# load trimr's library
library(trimr)
# load the example data that ships with trimr
data(exampleData)
# look at the top of the example raw data
head(exampleData)
# perform the trimming
trimmedData <- modifiedRecursive(data = exampleData, minRT = 150, digits = 0)
# look at the trimmedData
trimmedData
```
## Installation Instructions
To install the package from GitHub, you need the devools package:
```{r, eval = FALSE}
install.packages("devtools")
library(devtools)
```
Then *trimr* can be directly installed:
```{r, eval = FALSE}
devtools::install_github("JimGrange/trimr")
```
## 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.