censor: Censor missing values and RT outliers

Description Usage Arguments Examples

View source: R/utils.R

Description

censor requests a data frame minimally with three columns, indicating stimulus (S factor), response (R factor) and response time (RT).

Usage

1
censor(x, xlim = c(0, Inf))

Arguments

x

a data frame

xlim

the lower and upper censoring boundaries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
model <- BuildModel(
        p.map     = list(a = "1", v = "1", z = "1", d = "1", t0 = "1",
                    sv = "1", sz = "1", st0 = "1"),
        constants = c(st0 = 0, d = 0, sz = 0, sv = 0),
        match.map = list(M = list(s1 = "r1", s2 = "r2")),
        factors   = list(S = c("s1", "s2")),
        responses = c("r1", "r2"),
        type      = "rd")
p.vector <- c(a = 1, v = 1, z = 0.5, t0 = .15)
dat <- simulate(model, 100, ps = p.vector)
dmi <- BuildDMI(dat, model)

## Trim off RTs below .05 and above 10 s
censored_data <- censor(dat, xlim = c(.05, 10))

ggdmc documentation built on Sept. 2, 2018, 1:03 a.m.