Calculates the sample size for binomial tests (R.W. Payne & D.A. Murray).
|What to print (
||Method to be used to calculate the probabilities for the binomial test (
||Significance level for the test; default 0.05|
||The required power (i.e. probability of detection) of the test; default 0.9|
||Type of test to be done (
||Probability under the null hypothesis for the one-sample test; default 0.5|
||Ratio of replication sample2:sample1 (i.e. the size of sample 2 should be
||Replication values for which to calculate and print or save the power; default
||Probability to detect in sample 1|
||Probability to detect in sample 2|
||Saves the required number of replicates|
||Numbers of replicates for which powers have been calculated|
||Power (i.e. probability of detection) for the various numbers of replicates|
SBNTEST calculates the number of replicates (or sample size) required for a binomial test. A one-sample binomial test assesses the evidence that the probability of success within a sample differs from some specific value. The probability that needs to be detected is specified by the
P1 parameter, and the value from which it needs to be distinguished (i.e. the value under the null hypothesis) is specified by the
NULL option. If
NULL is not set, the default is 0.5. Alternatively, a two-sample test assess the evidence that probabilities within two samples are different. The anticipated probability within the first sample is then specified by the
P1 parameter, and the probability within the second sample (from which it must be distinguished) is specified by the
PRMETHOD option defines the type of binomial test that is to be done. The
normalapproximation setting relates to a test based on the Normal approximation to the binomial distribution (see the
BNTEST procedure), while the
angular setting is for a test using an angular transformation of the probabilities. The final setting,
exact, is available only for the one-sample test and assumes an exact test using the binomial distribution.
The significance level for the test is specified by the
PROBABILITY option (default 0.05 i.e. 5%). The required probability for detection of the difference between the probabilities (that is, the power of the test) is specified by the
POWER option (default 0.9). It is generally assumed that the sizes of the samples in the two-sample test should be equal. However, you can set the
RATIOREPLICATION option to a scalar,
R say, to indicate that the size of the second sample should be
R times the size of the first sample. By default,
SBNTEST assumes a one-sided test is to be used, but you can set option
TMETHOD=twosided to take a two-sided test instead. The
NREPLICATES parameter allows you to save the required size of the first sample.
||to print the required number of replicates in each sample (i.e. the size of each sample);|
||to print a table giving the power (i.e. probability of detection) provided by a range of numbers of replicates.|
By default both are printed.
The replications and corresponding powers can also be saved, in variates, using the
VPOWER parameters. The
REPLICATION option can specify the replication values for which to calculate and print or save the power; if this is not set, the default is to take 11 replication values centred around the required number of replicates.
PRMETHOD=normalapproximation, the distribution of the probability in sample i is approximated by a Normal distribution with mean pi and variance pi(1-pi)/ni, where pi is the binomial probability and ni is the sample size. With
PRMETHOD=angular, the probability is transformed to radians by an angular distribution, and the variance is then √(0.25/ni). For
PRMETHOD=exact, the calculations are done using the
EDBINOMIAL functions (one-sample test only).
Commands for: Design of experiments.
CAPTION 'SBNTEST example',\ '1) one-sample test, probability to detect 0.7.'; STYLE=meta,plain SBNTEST [PRINT=replication,power; TMETHOD=twosided] 0.7 CAPTION '2) two-sample test, probabilities 0.4 and 0.6.' SBNTEST [PRINT=replication,power; TMETHOD=twosided] 0.4; P2=0.6