Calculates one- and two-sample Poisson tests (D.A. Murray).
Options
PRINT = string tokens |
Controls printed output (test , summary , confidence ); default test , summ , conf |
---|---|
METHOD = string token |
Type of test required (twosided , greaterthan , lessthan ); default twos |
TEST = string token |
Form of the test for one-sample test (exact , normalapproximation ); default norm |
S1 = scalar |
Sample size for sample 1; default 1 |
S2 = scalar |
Sample size for sample 2; default 1 |
CIPROBABILITY = scalar |
The probability level for the confidence interval; default 0.95 |
NULL = scalar |
The value of the probability of success under the null hypothesis for the one-sample test |
Parameters
MU1 = scalars or variates |
Numbers recorded in the first sample |
---|---|
MU2 = scalars or variates |
Numbers recorded in the second sample |
NORMAL = scalars |
Saves the Normal approximation |
PROBABILITY = scalars |
Saves the probability value from the one-sample or two-sample tests |
LOWER = scalars |
Saves the lower limit of the confidence interval |
UPPER = scalars |
Saves the upper limit of the confidence interval |
Description
PNTEST
calculates one- and two-sample Poisson tests. The value for the mean under the null hypothesis for a one-sample test is specified by the option NULL
. You can supply the sample mean m1 as a scalar using the MU1
parameter. The sample size is then specified by the S1
option (with default 1). Alternatively, you can set MU1
to a variate containing the counts in the individual samples (and the sample size is then the number of non-missing values that it contains). With a two-sample test, parameters MU1
and MU2
similarly provide the means (m1 and m2) for samples 1 and 2 respectively, and the sample sizes can be specified using the S1
and S2
options.
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
will give a one-sided test of the null hypothesis that m1 > m2 or NULL
(for a two-sample or one-sample test, respectively). Similarly, METHOD=lessthan
will produce a test of the null hypothesis m1 < m2 or NULL
. A small “p-value” indicates that the data are inconsistent with the null hypothesis. The TEST
option specifies the form of test used for the one-sample test; either an exact test or a Normal approximation can be selected.
Printed output is controlled by the PRINT
option with settings:
summary |
mean, sample size, standard error (for Normal approximation); |
---|---|
test |
Normal approximation and probability level, or just probability level for the exact test; |
confidence |
confidence interval for the difference between the mean and NULL for a one-sample test, or the two means for a two-sample test. |
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 NORMAL
, PROBABILITY
, LOWER
and UPPER
parameters. NORMAL
saves the Normal approximation for the one- and two-sample tests, PROBABILITY
saves the probability level. LOWER
and UPPER
save the lower and upper limits, respectively, of the confidence interval.
Options: PRINT
, METHOD
, TEST
, S1
, S2
, CIPROBABILITY
, NULL
.
Parameters: MU1
, MU2
, NORMAL
, 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 141) of Arimitage & Berry (1994).
Reference
Arimitage, P. & Berry, G. (1994). Statistical Methods in Medical Research. Blackwell Science, Oxford.
See also
Procedures: BNTEST
, SPNTEST
, TTEST
.
Commands for: Basic and nonparametric statistics, Regression analysis.
Example
CAPTION 'PNTEST example',\ !t('Data from Armitage & Berry (1994), Statistical Methods in',\ 'Medical Research, pages 142 and 145.');\ STYLE=meta,plain PNTEST [NULL=20] MU1=33 CAPTION 'One-sample test, using exact test and confidence intervals.' PNTEST [NULL=20; TEST=exact] MU1=33 CAPTION 'One-sample test, one-sided.' PNTEST [NULL=20; METHOD=greater] MU1=33 CAPTION !t('Two-sample test, saving Normal approximation,',\ 'probability and confidence interval.') PNTEST MU1=13;MU2=31; NORMAL=norm; PROBABILITY=prob; LOWER=lower; UPPER=upper PRINT norm,prob,lower,upper