samediffPwr: Power Analysis for Same-different Experiments

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

View source: R/samediff.R

Description

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

Usage

1
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

1
2
3
4
5
6
## 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 Feb. 11, 2020, 1:10 a.m.