Discriminant Analysis in R

Sensory discrimination testing plays a vital role in food science, pharmaceuticals, cosmetics, beverages, consumer products, and quality assurance. Before launching a new product or modifying an existing formulation, researchers often need to determine whether consumers or trained panelists can detect a difference between products.

R provides a powerful framework for conducting sensory discrimination tests, enabling researchers to perform statistical analyses quickly and reproducibly. This article explains the most commonly used discrimination tests, their applications, assumptions, and implementation in R.

Note: Despite the title, the methods described here are sensory discrimination tests, not Linear Discriminant Analysis (LDA) used in machine learning. The discrim() function discussed here is designed for sensory evaluation.

What Is Sensory Discrimination Analysis?

Sensory discrimination analysis is a branch of sensory science used to determine whether two or more products are perceptibly different.

Unlike preference tests, which ask which product consumers like more, discrimination tests answer a different question:

Can people detect a difference between the samples?

These methods are widely used when:

  • Reformulating products
  • Reducing ingredient costs
  • Changing packaging materials
  • Comparing suppliers
  • Extending shelf life
  • Monitoring production consistency
  • Performing quality control

Typical products include:

  • Coffee
  • Chocolate
  • Wine
  • Dairy products
  • Soft drinks
  • Perfumes
  • Cosmetics
  • Pharmaceuticals
  • Pet food

Why Use R for Sensory Discrimination Analysis?

R offers several advantages:

  • Open-source and free
  • Highly reproducible analyses
  • Accurate p-value calculations
  • Confidence intervals
  • Multiple discrimination methods
  • Easy reporting and visualization
  • Integration with statistical workflows

Common Sensory Discrimination Tests

Different discrimination tests are appropriate depending on the study objective and experimental design.

Triangle Test

The Triangle Test is one of the most popular sensory discrimination methods.

Experimental Design

Each panelist receives:

  • Two identical samples
  • One different sample

The order is randomized.

Example:

A A B

or

A B A

or

B A A

Objective

Identify the odd sample.

Applications

  • Beverage reformulation
  • Recipe modifications
  • Flavor comparisons
  • Packaging changes

R Example

discrim(
x = 10,
n = 15,
method = "triangle",
statistic = "score",
conf.level = 0.90
)

where:

  • x = number of correct responses
  • n = total number of panelists

Duo-Trio Test

The Duo-Trio test is simpler than the Triangle Test and is suitable for untrained consumers.

Experimental Design

Panelists receive:

  • One reference sample
  • Two coded samples

One coded sample matches the reference.

Objective

Choose the coded sample identical to the reference.

Advantages

  • Easy to understand
  • Suitable for consumer studies
  • Less mentally demanding

R Example

discrim(
x = 10,
n = 15,
method = "duotrio",
statistic = "score",
conf.level = 0.90
)

Tetrad Test

The Tetrad Test is considered one of the most statistically efficient discrimination methods.

Experimental Design

Each participant receives:

  • Four samples
  • Two from Product A
  • Two from Product B

Objective

Group samples into two matching pairs.

Advantages

  • Higher statistical power
  • Requires fewer panelists
  • Greater sensitivity

R Example

discrim(
x = 10,
n = 15,
method = "tetrad",
statistic = "score",
conf.level = 0.90
)

Two-Out-of-Five Test

The Two-Out-of-Five test increases discrimination sensitivity.

Experimental Design

Five samples are presented.

Typically:

  • Three identical
  • Two identical

Objective

Correctly identify the matching pair.

Advantages

  • More powerful than Triangle Test
  • Reduced guessing probability

R Example

discrim(
x = 10,
n = 15,
method = "twofive",
statistic = "score",
conf.level = 0.90
)

Two-Alternative Forced Choice (2-AFC)

The 2-AFC test focuses on a specific sensory attribute rather than overall product difference.

Experimental Design

Two samples are presented.

Objective

Identify which sample has:

  • Greater sweetness
  • Higher bitterness
  • More saltiness
  • Greater aroma intensity
  • Higher crispness

Applications

  • Ingredient optimization
  • Sweetener comparisons
  • Salt reduction studies

R Example

discrim(
x = 10,
n = 15,
method = "twoAFC",
statistic = "score",
conf.level = 0.90
)

Three-Alternative Forced Choice (3-AFC)

The 3-AFC test extends the forced-choice concept.

Experimental Design

Three samples are presented.

Only one has the highest intensity for the evaluated attribute.

Objective

Identify the strongest sample.

Applications

  • Aroma intensity
  • Color intensity
  • Flavor strength
  • Texture evaluation

R Example

discrim(
x = 10,
n = 15,
method = "threeAFC",
statistic = "score",
conf.level = 0.90
)

Note: Some documentation may use "threAFC"; however, "threeAFC" is the commonly documented method name. Check your package version to confirm the supported option.


Understanding the Function Arguments

The discrim() function typically uses the following arguments:

ArgumentDescription
xNumber of correct responses
nTotal number of panelists
methodSensory discrimination protocol
statisticType of statistical calculation (e.g., score)
conf.levelConfidence level for interval estimation

Interpreting the Results

The output generally includes:

  • Test statistic
  • p-value
  • Confidence interval
  • Decision regarding the null hypothesis

Null Hypothesis (Hโ‚€)

Panelists cannot reliably distinguish between the products.

Alternative Hypothesis (Hโ‚)

Panelists can distinguish between the products.

Decision Rule

  • p-value < 0.05: Reject the null hypothesis. There is evidence of a perceptible difference.
  • p-value โ‰ฅ 0.05: Fail to reject the null hypothesis. There is insufficient evidence that the products differ perceptibly.

Choosing the Right Test

TestSamplesBest Used For
Triangle3General product comparisons
Duo-Trio3Consumer testing with a reference sample
Tetrad4High statistical power with trained panelists
Two-Out-of-Five5Detecting subtle differences
2-AFC2Comparing a specific sensory attribute
3-AFC3Identifying the strongest attribute intensity

Practical Applications

Sensory discrimination analysis is widely used in:

  • Food manufacturing
  • Beverage development
  • Dairy industry
  • Chocolate and confectionery
  • Coffee roasting
  • Wine tasting
  • Pharmaceutical formulation
  • Cosmetic product development
  • Fragrance evaluation
  • Pet food development
  • Consumer product research

Best Practices

To obtain reliable results:

  • Randomize sample presentation order.
  • Blind-code all samples.
  • Use trained panelists when possible.
  • Control serving temperature and environment.
  • Minimize fatigue by limiting the number of samples per session.
  • Select the discrimination test that matches your research objective.

Common Mistakes

Avoid these common pitfalls:

  • Using an inappropriate test for the research question.
  • Insufficient panel size.
  • Failing to randomize sample order.
  • Revealing product identities to participants.
  • Interpreting non-significant results as proof that products are identical.

Conclusion

Sensory discrimination tests provide a scientifically rigorous way to determine whether perceptible differences exist between products. R simplifies this process by offering flexible statistical functions for a variety of protocols, including the Triangle, Duo-Trio, Tetrad, Two-Out-of-Five, 2-AFC, and 3-AFC tests.

Selecting the appropriate test depends on your study objectives, product characteristics, and available panelists. By combining sound experimental design with reproducible R code, researchers and product developers can confidently evaluate product changes, support quality control decisions, and validate innovations across industries such as food, beverages, cosmetics, and pharmaceuticals.

You may also like...

6 Responses

  1. Hairstyles says:

    I’ve been absent for some time, but now I remember why I used to love this blog. Thanks , I will try and check back more frequently. How frequently you update your site?

  2. website says:

    Thanks for your marvelous posting! I definitely enjoyed reading it, you can be
    a great author. I will remember to bookmark your blog and may
    come back in the foreseeable future. I want to
    encourage you to continue your great writing, have a nice evening!

  3. If you are going for finest contents like myself, just visit this
    site everyday as it provides quality contents, thanks

  4. GMX Mail says:

    My spouse and I stumbled over here coming from a different page and thought I
    should check things out. I like what I see so now i’m following you.
    Look forward to looking at your web page repeatedly.

  5. It’s appropriate time to make a few plans for the long run and it’s
    time to be happy. I’ve learn this submit and if I may I want to
    counsel you few interesting things or advice.
    Maybe you could write next articles relating to this article.

    I desire to learn more things about it!

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − 1 =