Description Usage Arguments Details Value Author(s) References See Also Examples

Computes the probability of a correct answer (Pc), the probability of discrimination (Pd) and d-prime, their standard errors, confidence intervals and a p-value of a difference or similarity test for one of the four common discrimination protocols.

1 2 3 4 5 6 7 8 9 | ```
discrim(correct, total, d.prime0, pd0, conf.level = 0.95,
method = c("duotrio", "tetrad", "threeAFC", "twoAFC",
"triangle", "hexad", "twofive", "twofiveF"),
double = FALSE,
statistic = c("exact", "likelihood", "score", "Wald"),
test = c("difference", "similarity"), ...)
## S3 method for class 'discrim'
print(x, digits = max(3, getOption("digits")-3), ...)
``` |

`correct` |
the number of correct answers; non-negativescalar integer |

`total` |
the total number of answers (the sample size); positive scalar integer |

`d.prime0` |
The value of d-prime under the null hypothesis; numerical non-zero scalar |

`pd0` |
the probability of discrimination under the null hypothesis; numerical scalar between zero and one |

`conf.level` |
the confidence level for the confidence intervals |

`method` |
the discrimination protocol. Eight allowed values: "twoAFC", "threeAFC", "duotrio", "tetrad", "triangle", "twofive", "twofiveF", "hexad" |

`double` |
should the 'double' variant of the discrimination protocol be used? Logical scalar. Currently not implemented for "twofive", "twofiveF", and "hexad". |

`test` |
the type of test |

`statistic` |
the statistic to be used for hypothesis testing and confidence intervals |

`x` |
an object of class |

`digits` |
number of digits in resulting table of results |

`...` |
not currently used |

The degree of product difference/discrimination under the null
hypothesis can be specified on *either* the d-prime scale or on
the pd (proportion of discriminators) scale. This is done by using
either the `d.prime0`

*or* the `pd0`

arguments.
If unspecified, they default to zero and the
conventional difference test of "no difference" is obtained.

For a similarity test either `d.prime0`

*or* `pd0`

have
to be specified *and* and a non-zero, positive value should to be
given. Here, `d.prime0`

or `pd0`

define the ```
limit of
similarity
```

or `equivalence`

.

The probability under the null hypothesis is
given by `pd0 + pg * (1 - pd0)`

where `pg`

is the guessing
probability which is defined by the discrimination protocol given in
the `method`

argument.

All estimates are restricted to their allowed ranges, e.g. Pc is always as least as large as the guessing probability. Similarly confidence limits are also restricted to the allowed range of the parameters.

Standard errors are not defined when the parameter estimates are at
the boundary of their allowed range, so these will be reported as
`NA`

in such cases.

If `double = "TRUE"`

, the 'double' variants of the discrimination
methods is used. For example in a double-triangle test each participant
will perform two individual triangle tests and only obtain a correct
answer in the double-triangle test if both of the answers to the
individual triangle tests are correct. The guessing probability for
the double methods are lower than in the conventional discrimination
methods. If *p_g* is the guessing probability of the conventional
discrimination method, then *p_g^2* is the guessing probability of
the double variant of that discrimination method. All the double
discrimination methods have their own psychometric functions.

The `"Wald"`

statistic is *NOT* recommended for practical
use—it is included here for completeness and to allow comparisons.

For `statistic = "score"`

, the confidence interval is computed
from Wilson's score interval, and the p-value for the hypothesis
test is based on Pearson's chi-square test,
cf. `prop.test`

.

An object of class `discrim`

with elements

`coefficients` |
matrix of estimates, standard errors and confidence intervals |

`data` |
a named vector with the data supplied to the function |

`p.value` |
the p-value of the hypothesis test |

`call` |
the matched call |

`test` |
the type of test |

`method` |
the discrimination protocol |

`double` |
logical scalar; |

`statistic` |
the statistic used for confidence intervals and p-value |

`pd0` |
the probability of discrimination under the null hypothesis |

`alt.scale` |
the scale for the alternative hypothesis,
e.g.~ |

`conf.level` |
the confidence level |

`stat.value` |
for |

`df` |
for |

`profile` |
for |

Rune Haubo B Christensen and Per Bruun Brockhoff

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.

Bi, J. (2001) The double discrimination methods. Food Quality and Preference, 12, pp. 507-513.

`discrimPwr`

, `discrimSim`

,
`discrimSS`

, `samediff`

,
`AnotA`

, `findcr`

,
`profile`

,
`plot.profile`

`confint`

Link functions / discrimination protocols:
`triangle`

, `twoAFC`

,
`threeAFC`

, `duotrio`

,
`tetrad`

, `twofive`

,
`twofiveF`

, `hexad`

,

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
## Running the simple discrimination (difference) tests:
discrim(10, 15, method = "twoAFC")
discrim(10, 15, method = "threeAFC", statistic = "likelihood")
discrim(10, 15, method = "tetrad", statistic = "likelihood")
discrim(10, 15, method = "duotrio", conf.level = 0.90)
discrim(10, 15, method = "triangle", statistic = "score")
# Example of double duotrio discrimination test from Bi (2001):
discrim(35, 100, method = "duotrio", double=TRUE, statistic = "exact")
# Critical value for a sample size of 100 and a guessing probability of 1/4:
findcr(100, p0=1/4) # 33
## plot the distributions of sensory intensity:
m1 <- discrim(10, 15, method = "twoAFC")
plot(m1)
## A similarity test where less than chance successes are obtained:
discrim(22, 75, method = "triangle", d.prime0 = 1, test = "similarity")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.