misc: Miscellaneous Wiener Diffusion model functions

Description Usage Arguments Details Examples

Description

Miscellaneous functions for the RWiener package.

Usage

1
2
3
4
5
6
is.wiener(data)
as.wiener(data, yvar=c("q", "resp"))
## S3 method for class 'numdata.wiener'
revamp(data, ...)
## S3 method for class 'data.wiener'
revamp(data, ...)

Arguments

data

can be a data.wiener and/or data.frame with data (needs a reaction time column and a accuracy/response column). Further it can be a numdata.wiener and/or numeric with the data as single variable (lower bound reaction times are then represented as negative numbers, upper bound reaction times as positive numbers).

yvar

represents an optional vector, that can be used to define the names of the reaction time column (first value) and the accuracy/response column (second value), if a data.wiener and/or data.frame is given as data.

...

optional arguments: yvar (as described above) and direction: character string that can be used to define the desired format of the returned data. "wide" returns a numdata.wiener, "long" returns a data.wiener.

Details

data.wiener and numdata.wiener are data objects that represent data coming from a Wiener Diffusion process. data.wiener uses a data.frame with 2 columns for the 2 response variables ("q" and "resp" by default). numdata.wiener emulates a single variable representation by using a vector, that stores the responses for the upper boundary as positive numbers and the responses for the lower boundary as negative numbers. This is similar to the transformation: Y=(2D-1)RT; where Y is the single variable, that preserves all the information from the decision variable D (1 or 0) and the reaction time variable RT.

The as.wiener function can be used to create wiener data objects (data.wiener or numdata.wiener), that can be used by generic functions, e.g. plot.

is.wiener checks if the given data is a wiener data object (data.wiener or numdata.wiener).

revamp.data.wiener and revamp.numdat.wiener can be used to transform data.wiener objects to numdata.wiener objects and vice versa. The generic function revamp(data, ...) can be called for convenience.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## generate data
dat <- rwiener(100, 4,.35,.5,0.8)

## simple function calls
is.wiener(dat)
dat <- as.data.frame(dat)
dat <- as.wiener(dat)
y <- revamp(dat)
y
revamp(y)

RWiener documentation built on May 5, 2020, 1:05 a.m.

Related to misc in RWiener...