Learn R Programming

grt (version 0.1.0)

dprime: Calculate d' (d-prime)

Description

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

Usage

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 speficy a general linear decision bound. The list should contain noise, coeffs, bias.
zlimit
numeric. The z-scores (or discriminant scores) beyond the speficied 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 respo
means
a list of numeric vectors containing the means of two distributions
covs
a matrix or a list of matrices containig the variance-covariance matrix of the two discributions
noise
numeric. perceptual and criterial noise expressed as standard diviation. Default to NULL

Details

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

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

References

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

Examples

Run this code
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)

Run the code above in your browser using DataLab