Learn R Programming

sensR (version 1.2.2)

discrim: Sensory discrimination analysis

Description

Computes the d-prime, its standard error and P-value for the hypothesis of no sensory difference for any of four methods: 2-AFC, 3-AFC, duotrio and triangle tests.

Usage

discrim(success, total,
        method = c("duotrio", "threeAFC", "twoAFC", "triangle"),
        pd0 = 0, type = c("difference", "similarity"), ...)

## S3 method for class 'discrim':
print(x, digits = getOption("digits"), alpha = 0.05, ...)

Arguments

success
the number of correct answers
total
the total number of answers (sample size)
method
the discrimination protocol. Four allowed values: "twoAFC", "threeAFC", "duotrio", "triangle"
pd0
the proportion of discriminators in the population of interest
type
the type of test
x
an object of class "discrim"
alpha
the allowed type I level of the Wald based confidence interval
digits
number of digits in resulting table of results
...
additional arguments passed to glm

Value

  • An object of class discrim with elements
  • coefficientsnamed vector of coefficients (d-prime and tau)
  • res.glmthe glm-object from the fitting process
  • vcovvariance-covariance matrix of the coefficients
  • senamed vector with standard error of the coefficients (standard error of d-prime)
  • dataa named vector with the data supplied to the function
  • p.valueone-tailed exact binomial p-value
  • testa string with the name of the test for the print method
  • callthe matched call

Details

The p-value for the standard one-tailed difference test of "no difference" is obtained with pd0 = 0. The probability under the null hypothesis is given by pd0 + p0 * (1 - pd0) where p0 is the guessing probability defined by the method argument. The function uses the one of the dedicated binomial families and the base function glm

References

Brockhoff, P.B. and Christensen, R.H.B (2010). Thurstonian models for sensory discrimination tests as generalized linear models. Food Quality and Preference, 21, pp. 330-338.

See Also

triangle, twoAFC, threeAFC, duotrio, discrimPwr, discrimSim, discrimSS, samediff, AnotA, findcr

Examples

Run this code
## Running the simple discrimination (differens) tests:
discrim(10, 15, method = "twoAFC")
discrim(10, 15, method = "threeAFC")
discrim(10, 15, method = "duotrio")
discrim(10, 15, method = "triangle")

## A similarity test where less than chance successes are obtained:
discrim(20, 75, "triangle", pd0 = .2, type = "simil")

Run the code above in your browser using DataLab