dprime: Calculate d' (d-prime)

Description Usage Arguments Details Author(s) References Examples

View source: R/dprime.R

Description

Obtain the standardized distance between the two probability distributions, known as d' or sensitivity index.

Usage

1
2
3
4
5
6
7
8
dprime(x,
    category,
    response,
    par = list(),
    zlimit = Inf,
    type = c("SampleIdeal", "Observer"))

dprimef(means, covs, noise=NULL)

Arguments

x

a data frame or matrix containing samples from two multivariate normal distributions.

category

a vector or factor of labels of populations to which the samples belong

response

a vector or factor specifying the participant's classification responses for each samples

par

object of class glcStruct or a named list containing a set of parameters that specify a general linear decision bound. The list should contain noise, coeffs, bias.

zlimit

numeric. The z-scores (or discriminant scores) beyond the specified value will be truncated and replaced with that value. Default to Inf

type

a character string specifying the type of d' to be returned. If SampleIdeal, d' is calculated based on ideal (or true) category membership as specified in category. If Observer, d' is calculated using the response vector as a grouping factor.

means

a list of numeric vectors containing the means of two distributions

covs

a matrix or a list of matrices containing the variance-covariance matrix of the two distributions

noise

numeric. perceptual and criterial noise expressed as standard deviation. Default to NULL

Details

The function dprime estimates d' from sample data sets, whereas the function dprimef calculates it from population parameters.

In dprime, if any parts of the argument par are missing, the function will estimate an optimal linear decision bound from supplied x and category. The argument response is not used if type is SampleIdeal.

Author(s)

Author of the original Matlab routines: Leola Alfonso-Reese

Author of R adaptation: Kazunaga Matsuki

References

Alfonso-Reese, L. A. (2006) General recognition theory of categorization: A MATLAB toolbox. Behavior Research Methods, 38, 579-583.

Examples

1
2
3
4
5
6
7
data(subjdemo_2d)
d2 <- subjdemo_2d
db <- glcStruct(noise=10, coeffs=c(0.514,-0.857),bias=-0.000154)
dprime(d2[,2:3], d2$category, d2$response, par = db, zlimit=7, type='SampleIdeal')

mc <- mcovs(category ~ x + y, data=d2)
dprimef(mc$means, mc$covs)

matsukik/grt documentation built on May 21, 2019, 12:57 p.m.