samediffPwr | R Documentation |
Computes the power for at same-different discrimination experiment with a no-difference null hypothesis via simulation.
samediffPwr(n = 1000, tau, delta, Ns, Nd, alpha = 0.05)
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) |
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.
A single numeric value giving the power of the specified test.
Rune Haubo B Christensen
Christensen, R.H.B., Brockhoff, P.B. (2009). Estimation and inference in the same-different test. Food, Quality and Preference, 20 pp. 514–520
samediff
, samediffSim
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.