fpGet: Function to compute densities and density differences for...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function computes standard kernel-based density functions for a response time data set with three or more conditions. In addition, it computes the pairwise differences for each pair of density functions.

Usage

1
fpGet(dat, n = 512, bw = "nrd0")

Arguments

dat

n*2 dataframe or matrix with in col 1: RT (the values for which to compute the density); col 2: condition (an index)

n

the number of equally spaced points at which the density is to be estimated. See density for details.

bw

the smoothing bandwidth to be used. See density for details.

Value

an object of class fp1, with the following components.

dens

list of objects from class density

diff

dataframe of the density differences

dat

dataframe with the input data

Author(s)

Leendert van Maanen (l.vanmaanen@uva.nl)

References

Van Maanen, L. & Van Rijn, H (submitted). The fixed-point property in concurrent processing. Manuscript submitted for publication

See Also

density.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
### one data set or participant
## generate data
p <- c(.1,.5,.9)
rt <- sapply(1:3, function(i) {rnormMix(1000, c(1,2), c(1,1), p[i])})
dat <- data.frame(rt=c(rt), cond=rep(1:3, each=1000))

## compute one fp object
fpobject <- fpGet(dat, 1000, bw=.75)


### multiple participants
## generate data
p <- c(.1,.5,.9)
rt <- sapply(1:3, function(i) {rnormMix(10000, c(1,2), c(1,1), p[i])})
dat <- data.frame(rt=c(rt), cond=rep(1:3, each=10000), pp=rep(1:50, each=200, times=3))

## compute the list of fp1 objects
res <- tapply(1:nrow(dat), dat$pp, function(X) {fpGet(dat[X,], 1000, bw=.75)})

JimGrange/Van-Maanen-fp documentation built on May 7, 2019, 10:51 a.m.