rescale: Transform or rescale between pc, pd and d-prime for sensory...

View source: R/utils.R

rescaleR Documentation

Transform or rescale between pc, pd and d-prime for sensory discrimination protocols

Description

Transforms or rescales estimates and optionally standard errors between the three levels at which a sensory difference is measured: pc (proportion of correct answers), pd (proportion of discriminators) and d-prime. rescale is the main function and only one of pc, pd or d-prime should be given as argument — values for the remaining two scales will be computed.

A number of auxiliary functions are also provided:

psyfun

implements the psychometric functions and maps from d-prime to pc

psyinv

implements the inverse psychometric functions and maps from pc to d-prime

psyderiv

implements the derivative of the psychometric functions

pc2pd

maps from pc to pd

pd2pc

maps from pd to pc

Usage


rescale(pc, pd, d.prime, std.err,
        method = c("duotrio", "tetrad", "threeAFC", "twoAFC",
        "triangle", "hexad", "twofive", "twofiveF"),
        double = FALSE)

psyfun(d.prime, method = c("duotrio", "tetrad", "threeAFC", "twoAFC",
       "triangle", "hexad", "twofive", "twofiveF"),
        double = FALSE)

psyinv(pc, method = c("duotrio", "tetrad", "threeAFC", "twoAFC",
       "triangle", "hexad", "twofive", "twofiveF"),
        double = FALSE)

psyderiv(d.prime, method = c("duotrio", "tetrad", "threeAFC", "twoAFC",
         "triangle", "hexad", "twofive", "twofiveF"),
        double = FALSE)

pc2pd(pc, Pguess)

pd2pc(pd, Pguess)

Arguments

pc

the proportion of correct answers; a numerical vector between 0 and 1

pd

the proportion of discriminators; a numerical vector between 0 and 1

d.prime

the sensory difference on the d-prime scale; a non-negative numerical vector.

std.err

optional numerical vector of standard errors of the same length as the either of pc, pd or d.prime. Negative values are not allowed, but values may be NA

method

the sensory discrimination protocol for which the results should apply

double

should the 'double' variant of the discrimination protocol be used? Logical scalar.

Pguess

the guessing probability implied by the protocol; a numeric scalar between 0 and 1

Details

The rescale function is based on the fact that once the protocol and one of pc, pd and d-prime is known, the other two can be computed. The same applies to the standard errors of these parameters.

Standard errors are optional, but if they are supplied, the length of the std.err argument has to match the length of pc, pd or d.prime whichever is given.

A print method is implemented for rescale objects.

Value

For rescale an object of class rescale with elements

coefficients

a data.frame with values of pc, pd and d.prime corresponding to the input

std.err

if standard errors are given trough the std.err argument a data.frame of the same size and shape as coefficients with standard errors. Otherwise missing.

method

the sensory discrimination protocol for which the results apply

For psyfun, psyinv, psyderiv, pc2pd and pd2pc a numerical vector of the same length as the first argument with appropriate contents.

Author(s)

Rune Haubo B Christensen

Examples


## suppose 15 out of 20 are observed in a duo-trio experiment, then
## the estimated probability of correct a answer is
(pc <- 15/20)
## The standard error of this estimate is
(se.pc <- sqrt(pc * (1 - pc) / 20))
## The corresponding estimate of proportion of discriminators (pd) and
## d-prime with associated standard errors are:
rescale(pc = pc, std.err = se.pc, method = "duotrio")

## Can also do
rescale(pd = c(.6,.7), std.err = c(.2, NA))
psyfun(2, method = "triangle")
psyinv(0.8, method = "twoAFC")
psyderiv(2, method = "duotrio")
pc2pd(0.7, 1/2)
pd2pc(0.3, 1/3)


sensR documentation built on Nov. 2, 2023, 6:02 p.m.