samediffPwr: Power Analysis for Same-different Experiments

View source: R/samediff.R

samediffPwrR Documentation

Power Analysis for Same-different Experiments

Description

Computes the power for at same-different discrimination experiment with a no-difference null hypothesis via simulation.

Usage

samediffPwr(n = 1000, tau, delta, Ns, Nd, alpha = 0.05)

Arguments

n

the number of samples to use in the simulation. More samples means higher precision, but takes longer to compute.

tau

the value of tau

delta

the underlying sensory difference under the alternative hypothesis (non-negative)

Ns

the number of same-samples (a positive integer)

Nd

the number of different-samples (a positive integer)

alpha

the type I level of the test (must be between zero and one)

Details

The power is computed using simulations. n datasets is simulated from the Same Different model with specified parameters. The power is the fraction of times the p-value is lower than alpha.

Under some parameter combinations, there is a non-significant probability that data will fall, so that the MLE of delta is not defined and the p-value is not defined. All such undefined p-values are silently ignored.

The estimated power may change between runs and especially if the power is either very large or very small (ie. close to 0 or 1). Using more simulations will provide higher accuracy.

It is often a good idea to run the power simulation a couple of times to ensure that the variation in the result is acceptable.

Value

A single numeric value giving the power of the specified test.

Author(s)

Rune Haubo B Christensen

References

Christensen, R.H.B., Brockhoff, P.B. (2009). Estimation and inference in the same-different test. Food, Quality and Preference, 20 pp. 514–520

See Also

samediff, samediffSim

Examples

## Finding the power of a discrimination test with a sensory delta of 2
## (alternative hypothesis) versus a null hypothesis of delta = 0 with
## a sample of size 2 x 10 and a type I level of .05. n should be higher
## for a reasonable precision:

samediffPwr(n = 100, tau = 1, delta = 2, Ns = 10, Nd = 10)


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