discrim: Sensory discrimination analysis

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

View source: R/discrim.R

Description

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.

Usage

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), ...)

Arguments

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 "discrim"

digits

number of digits in resulting table of results

...

not currently used

Details

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.

Value

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; TRUE if a double discrimination method is used, otherwise FALSE

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.~"d.prime" or "pd"

conf.level

the confidence level

stat.value

for statistic != "exact" the value of the test statistic used to calculate the p-value

df

for statistic == "score" the number of degrees of freedom used for the Pearson chi-square test to calculate the p-value

profile

for statistic == "likelihood" the profile likelihood on the scale of Pc

Author(s)

Rune Haubo B Christensen and Per Bruun Brockhoff

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.

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

See Also

discrimPwr, discrimSim, discrimSS, samediff, AnotA, findcr, profile, plot.profile confint

Link functions / discrimination protocols: triangle, twoAFC, threeAFC, duotrio, tetrad, twofive, twofiveF, hexad,

Examples

 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")

sensR documentation built on May 2, 2019, 9:43 a.m.