BNTEST procedure
Calculates one- and two-sample binomial tests (D.A. Murray).
Options
Parameters
Description
BNTEST calculates one- and two-sample binomial tests, and odds ratios. For a one-sample test, the number of successes r1 can be specified using the R1 parameter, and the sample size n1 using the N1 parameter (both as scalars). Alternatively you can supply the raw data, by setting R1 to a variate containing one in the units corresponding to successful trials and zero in those for unsuccessful trials. The test is for the probability of success under a binomial distribution. The value for the probability under the null hypothesis is 0.5 by default, but you can specify other probabilities using the NULL option. With a two-sample test, R1 and N1 similarly provide the number of successes and sample size for the first sample (r1 and n1), and R2 and N2 those for the second sample (r2 and n2).
For both one- and two-sample cases, the test is assumed to be two-sided unless otherwise requested by the METHOD option. Setting METHOD=greaterthan gives a one-sided test of the null hypothesis that r1/n1 > r2/n2 or NULL (for a two-sample or one-sample test, respectively). Similarly, METHOD=lessthan produces a test of the null hypothesis r1/n1 < r2/n2 or NULL. A small "p-value" indicates that the data are inconsistent with the null hypothesis.
The TEST option specifies the form of test to be used. For the one-sample test, an exact test or Normal approximation can be selected. For a two-sample test, a Normal approximation or odds ratio can be chosen.
Printed output is controlled by the PRINT option with settings:
The default is to print everything.
By default a 95% confidence interval is calculated, but this can be changed by setting the CIPROBABILITY option to the required value (between 0 and 1).
Results can be saved using the STATISTIC, PROBABILITY, LOWER and UPPER parameters. STATISTIC saves the Normal approximation for the one- and two-sample tests or the odds ratio, PROBABILITY saves the probability level. LOWER and UPPER save the lower and upper limits, respectively, of the confidence interval; for the odds ratio the confidence interval is saved for the true odds ratio.
Options: PRINT, METHOD, TEST, CIPROBABILITY, NULL.
Parameters: R1, N1, R2, N2, STATISTIC, PROBABILITY, LOWER, UPPER.
Method
A standard Normal approximation is used for both the one- and two-sample tests. The exact test and confidence intervals are based on the methodology described in Chapter 4 (page 121) of Armitage & Berry (1994). The odds ratio is a relative measure of the odds of a success in one set of data relative to that in the other. The estimate of the ratio is defined as
p1 (1 - p1) / p2 (1 - p2)
where p1 and p2 are the success probabilities in two sets of data. The calculation of the approximate standard error of the estimated log-odds ratio and confidence intervals is described in Chapter 2 (page 36) of Collett (1991).
References
Armitage, P. & Berry, G. (1994). Statistical Methods in Medical Research. Blackwell Science, Oxford.
Collett, D. (1991). Modelling Binary Data. Chapman & Hall, London.