Multiple comparisons and nonparametric statistical tests on a programmable calculator

Multiple comparisons and nonparametric statistical tests on a programmable calculator

Multiple Comparisons and Nonparametric on a Programmable Calculator Statistical Tests ARYEH HURWITZ Calculator programs are provided for statistica...

840KB Sizes 0 Downloads 118 Views

Multiple Comparisons and Nonparametric on a Programmable Calculator

Statistical Tests

ARYEH HURWITZ

Calculator programs are provided for statistical tests for comparing groups of data. These tests can be applied when t-tests are inappropriate, as for multiple comor for evaluating groups of data that are not distributed normally or have unequal variances. The programs, designed to run on the least expensive parisons,

Hewlett-Packard programmable scientific calculator, Model HP-IIC, should place these statistical tests within easy reach of most students and investigators.

Key Words: Nonparametric

Statistical tests; Programmable tests

calculator;

Multiple

comparisons;

INTRODUCTION Biomedical data often require multiple comparisons to establish significant differences between treatment groups (Godfrey, 1985; Longnecker, 1982). While the commonly used Student’s t-test is convenient and widely used, most statisticians are quick to point out that it is not valid if more than two groups are compared. Other limitations of the t-test include assumption of normal distribution of data and equal variances of groups. Deviations from these characteristics make a nonparametric test more appropriate. Valid tests for multiple comparisons and nonparametric analyses are readily available. They require the use of computers and software that are quite expensive and not always accessible. To overcome these hurdles, the following programs have been written to run on a small inexpensive programmable hand calculator with continuous memory. After the few minutes it takes to enter the programs, data can be entered conveniently and, by referring to tables, statistical significance can be established. METHODS Select the statistical test appropriate for analysis of the data by referring to Table 1. If in doubt, consult any standard statistics text (Schefler, 1979; Sokal and Rohlf, 1981; Steel and Torrie, 1980; Winer, 1971; Zar, 1984). The programs corresponding to the tests are listed in Tables 2A to 8A. The programs in this paper have been written to run on the Hewlett-Packard HP-IIC calculator, which operates by Reverse

From the Division of Clinical Pharmacology, University of Kansas Medical Center, Kansas City, Kansas. Address reprint requests to: Aryeh Hurwitz, M.D., Clinical Pharmacology, University of Kansas Medical Center, 39th & Rainbow Blvd, Kansas City, KS 66103. Received January 14, 1986; revised and accepted May 27, 1986.

27 Journal of Pharmacological Methods 0 1987 Elsevier Science Publishing

17,27-38

(1987)

Co., Inc., 52 Vanderbilt

0X0-5402/87/$03.50 Avenue, New York, NY 10017

28

A. Hurwitz TABLE 1

Statistical Tests for Examining Differences

Between Groups

Two SAMPLES Parametric Normal distribution Equal variances Compare means

Student’s

MULTIPLESAMPLES

t-test=

ANOVA with multiple comparisons (Tukey, Newman-Keuls, Duncan)” ANOVA for repeated measures with multiple comparisonsb

Paired t-testb

Nonparametric Distribution-free Based on ranks Compare medians

Mann-Whitney

U testa

Kruskal-Wallis with Dunn’s multiple comparisons testa Friedman’s test with multiple comparisons test (Tukey)b

Wilcoxon paired-sample (signed-rank) testb

a Different subjects for each treatment. b Each subject gets all treatments (paired or crossover).

Polish Notation. They have not been tested on other machines, but should run on any calculator with similar key functions and capabilities. Before entering any program, with the calculator off, simultaneously depress the [ON] and [-I keys. Display of “Pr Error” indicates that programs and data have been cleared from memory. Pressing any key and then [g] [P/RI resets the calculator so that program entry may TABLE 2A STEP

001

002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022

ANOVA

and Multiple

Comparisons Program

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

g P/R f LBL A H+ R/S gx R/S gs RCL 0 & I R/S RCL 1 ST0 + g x2 RCL 0 R/S ST0 + I ST0 + RCL 2 ST0 + RCL . 0 1

023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045

+

046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068

_

069

ST0 ‘0 f CLEAR Z R/S f LBL B RCL ‘0 1 _ R/S RCL 9 RCL 8 _ RCL 7 RCL '0 R/S I ST0 5 RCL 6 g x2 RCL 7 I RCL 8

1 RCL ‘0 _ z RCL 5 I R/S f LBL C 0 f LBL 1 R/S ST0 .I R/S ST0 .2 R/S ST0 .3 R/S ST0 .4 R/S RCL .I RCL .3 -

070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087

RCL ‘2 l/x RCL .4 l/x + RCL 5

6

7 8 9

X

2 > L g ABS GTO 1 f LBL D f CLEAR C g RTN f LBL E f CLEAR REG f CLEAR H g P/R f USER

Multiple TABLE 2B

Instructions for Running ANOVA

and Multiple INPUT

STEP

1 2 3 4 5 6 7

a 9 10 11 12 13 14 15 16 17

ia

Key in program (Table 2A) Clear registers-reset for entry of new data Enter data Calculate mean of current group Calculate standard error of current group Display sample size of current group Reset-clear registers for next group Repeat steps 3-7 for each group set of data Calculate degrees of freedom-numerator Calculate degrees of freedom-denominator (for f and multiple comparisons) Calculate value of F (for ANOVA) Reset for multiple comparisons of means Enter mean of first group (from step 4) Enter sample size of first group (from step 6) Enter mean of second group (step 4) Enter sample size of second group (step 6) Calculate 9 for difference between means Repeat steps 13-17 for each pair of means

x”

Comparison

Calculator Programs

Comparisons KEYSTROKES OUTPUT

E A R/s R/S R/S R/S

0.0000 Number of entry x SEM n 0.0000

6 R/S

d.f., d.f.2

R/S C R/S R/S R/S IUS R/S

F 0.0000

jr, 4

xb nb 9

* Record these values for data presentation and for determining significant differences. If calculated 9 is greater than value in table, means are significantly different. Notes: If an error is made in entering data, keystroke [DI will erase entries from the current set and retain other, correct, data entered earlier. Then the present set can be reentered. If an error is made in the sequence to compute 9 for differences between means (steps 13-16), keystroke [Cl will reset to step 13. If means from only two groups are compared, keystrokes [fl [&I after step 11 will display t (which equals G) for the degrees of freedom displayed in step 10. Alternatively, a value of F for one degree of freedom in the numerator has identical significance tot. If SD is desired, insert keystroke [R/S1 between steps 006 and 007 when entering the program in Table 2A. Examples: Schefler (1979), pp. 132-140; Sokal and Rohlf (IV&l), pp. 220-221, pp. 246-247; Steel and Torrie (1%X0), pp. 140-142, pp. 185-188; Zar (1984), pp. 164-165, pp, 186-191. Mean for group 2 on p. 164 should be 69.3. Step 17 above yields 9, which can then be compared directly with tabulated values to ascertain significance of differences between means. Several of the references describe calculation of critical differences between means. Xi - x. Since 9 =

‘&lculated

then -

I,

si

qtable

=

xi

-

xj

critical difference



These ratios can be checked to verify calculations.

proceed. If program steps are inadvertently keyed incorrectly, the [+I key will serially erase these entries so that further correct steps may be entered. Data analyses are performed as indicated in the B Tables. One may check the programs and computations by entering the data in problems that are worked out in the standard texts. Verified examples are listed after the tables. Since the calculator does not round off intermediate steps, values computed by it may deviate slightly from those in books, but usually not before the third significant figure. The books also demon-

29

A. Hurwitz TABLE 3A STEP

001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022

ANOVA With Repeated Measures and Multiple

Comparisons

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

g P/R f LBL A 0 xzy S+ g LSTX ST0 + 3 ST0 + (i) RCL I 1 + ST0 I 6 R/S ST0 4 RCL 3 g x2 ST0 + 5 f LBL 1 6 ST0 I 0

023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045

ST0 3 g RTN f LBL B RCL (i) g x2 ST0 + 3 RCL (i) RCL 0 RCL 4 I ST0 6 + R/S RCL I 1 + ST0 I CT0 B f LBL C RCL 3 RCL 6 2 RCL 1

046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068

g x2

069

ST0 9

RCL 2 _ ST0 RCL RCL RCL z + RCL 1 _ ST0 R/S RCL 1 -

070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089

l/x

0

7 2 5 4

4

8 6

X

R/S I CHS

RCL7

RCL 8 I fxLBL D R/S ENTER R/S _ RCL 9 RCL 6 2 I g ABS CT0 D f LBL E f CLEAR REG CT0 1 g P/R f USER

TABLE 3B Instructions for Running ANOVA With Repeated Measures and Multiple Comparisons STEP 1

2

9

10 11

12

13

INPUT

INSTRUCTIONS

Key in program (Table 3A) Clear registers-reset for entry of new data Enter data in treatment sequence by subject Reset for next subject after all treatments Repeat steps 3 and 4 for each subject Calculate mean for first treatment Calculate means for other treatments Calculate degrees of freedomnumerator Calculate degrees of freedomdenominator (for F and multiple comparisons) Calculate value of F (for ANOVA) Enter mean for first treatment Enter mean for second treatment and calculate q for difference between means Repeat steps 11 and 12 for all mean pairs

* Record these values for data presentation

Xij

OUTPUT

E

0.0000

A

Number of entry (treatment) 0.0000

WS

%l

x,

and for determining different.

q is greater than value in table, means are significantly

KEYSTROKES

B R/S C

Xl

WS

d.f.2

ws ws ws

%l 4

significant

j?2 to jz” d.f., *

F

differences.

If calculated

Multiple TABLE 38

Comparison

Calculator Programs

(cont.)

Notes: This program will enable comparisons of up to nine different treatments for an indefinite number of subjects. SE or SD for each treatment are not displayed. If these are desired, reenter data for each treatment with keystroke [2+] and then calculate SD with [gl [Sl and SE by dividing by V%. There is no provision for correcting a wrong entry. One must return to step 2 (keystroke [El) and reenter all data. This program has no provision to compensate for data missing from the block design. If an error is made in calculating q, one may restart with keystroke [Cl, step 8, and continue as indicated. Examples: Schefler (1979), pp. 150-154 [There is an error in the example on these pages; Problem 9.3 (p. 158, answer on p. A-27) is solved correctly]; Sokal-Rohlf (1981), pp. 352-353; Steel-Torrie (1980), pp. 197-201; Zar (1984), pp. 223-224. Of these texts only Zar (1984) has a brief discussion of multiple comparisons (p. 226). A complete discussion including a solved example, is found in the book by Winer (1971, pp. 261-271). Some of the references calculate sums of values. The above program calculates means (steps 6 and 7), which may be multiplied by n, the number of subjects, to yield the values in the texts.

TABLE 4A STEP

001

002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027

Kruskal-Wallis and Dunn’s Test

KEYSTROKES

STEP

KEYSTROKES

STEP

g P/R f LBL A 2+ R/S gR R/S RCL 1 ST0 + 6

028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055

ST0 + 5 g LSTx R/S f LBL C RCL 9 1 R/S RCL 7 1 2

056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077

X

ST0 + 7 1 ST0 + 9 RCL 0 ST0 + 8 R/S f CLEAR H R/S f LBL 1 ENTER ENTER 3 Y” xsy _ g RTN f LBL B GSB 1 CHS

X

RCL 8 RCL 8 1 + ST0 .O X

RCL 6 2 X

f x#y :;lN-’ I RCL .O 3 X

078 079 080 081 082 083

KEYSTROKES

RCL CSB ST0 l/x RCL

8 1 .I 5

X

1 + 2 R/S RCL .I RCL 5 + RCL 8 1 _ + 1 2 2 ST0 .2 0 f LBL 2 R/S ST0 1 R/S ST0 2

STEP

KEYSTROKE

084

R/S ST0 R/S ST0 RCL RCL

085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 106 107

3 4 1 3

RCL 2 l/x RCL4 l/x + RCL .2 % i g ABS CT0 2 f LBL D f CLEAR B R/S f LBL E f CLEAR REG f CLEAR 2 g P/R f USER

31

32

A. Hurwitz TABLE 4B STEP 1

2 3 4

Instructions for Running Kruskal-Wallis and Dunn’s Tests

IN~TRUC~I~N~ Key in program (Table 4A) Clear registers-reset for entry of new data Enter ranks from first (treatment) group Calculate mean rank of group

5 6 7 8 9 10 11 12 13

Display sample size of group Reset for next (treatment) set of data Repeat steps 3-6 for each set treatment Enter each number of ties Repeat for all ties Calculate d.f. for Kruskal-Wallis Calculate H (for Kruskal-Wallis) Reset for Dunn’s test Enter R, (mean rank for group A)

14 15

Enter Sample size of group A Enter Rb (mean rank for group B)

16

Enter sample size of group B and calculate Q for Dunn’s test Repeat steps 13-16 for all pairs of means

17

INPUT

KEYSTROKES OUTPUT

R“a

E A R/s

0.0000 _Number of entry n, 0.0000

t1 L

R,

B B C R/S R/S R/S

“a Rb

R/S R/S

“a

nb

R/S

Q

t1 t,

*

R,

R/S Rls

+

d.f. H 0.0000

k b

*

* Record these values for determining significant differences. Notes: If an error is made in data entry, keystroke [Dl will delete the current set of data, including the error, leaving earlier correct entries intact. Then the current set may be reentered correctly. A display of “Error 0” at step 11 means that ranks were calculated or entered incorrectly. This error must be corrected, registers cleared (step 2), and ranks reentered (step 3) before value of H can be computed. Steps 8 and 9 may frequently be skipped, as ties usually affect the values of H and Q very little. If errors are made or critical values not recorded beyond step 9, step 10 (keystroke [Cl) and all subsequent steps may be repeated. Examples: Schefler (1979), pp. 221-223. Calculator displays “Error” when ranks from worked example are entered. Problem 12.9 (p. 227, answer on p. A-30) is solved correctly. Sokal-Rohlf (1981), pp. 430432; Steel-Torrie (1980), pp. 544-545. Zar (1984), pp. 176-179; pp. 200-201. This is the only one of these texts that discusses and gives examples of multiple comparisons. However, there is an error in the comparison of groups 3 and 2 on p. 201. Since group 3 has n of 7, correct Q = 0.88 (which does not affect conclusions). Calculator displays mean ranks (step 4). Multiply by n (step 5) to get sums of ranks, as in some of the references.

TABLE 5A STEP

001 002 003 004 005 006 007 008 009 010

Friedman Test With Multiple Comparisons

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

g P/R f LBL A ST0 + (i) f LBL 1 RCL I 1 + ST0 I 1 _

011

f LBL B 1 ST0 I RCL ’ 4 + ST0 .4 R/S f LBL 2 RCL (i) RCL ‘4 I

022 023 024 025 026 027 028 029 030 031 032

gx=o

033 034 035 036 037 038 039 040 041 042 043

f LBL 3 RCL I RCL I 2 _

g RTN

012 013 014 015 016 017 018 019 020 021

CT0 3 R/S RCL (i) ST0 + 0 g x2 RCL ‘3 + ST0 .3 CSB 1 CT0 2

ST0 . 0 1 + ST0 6 X

RCL .4

Multiple TABLE 5A STEP

STEP

044

x

045

2

046 047 048 049 050 051 052 053 054 055 056 057

i ST0 7 RCL 0 f x#y g SIN-’ f CLEAR X f LBL C ENTER ENTER 3 y” X+

KEYSTROKES

STEP

KEYSTROKES

STEP

058

-

072

ST0

086

-

059

ST0

073

RCLI

087

060 061 062 063 064 065 066 067 068 069 070 071

g LSTx R/s f LBL D RCL .3 RCL 7 g x2 RCL 6 + RCL 7 6 +

074 075 076 077 078 079 080 081 082 083 084 085

RCL .O R/s + 1 2 f i f LBL 4 R/S ENTER R/S

088 089 090 091 092 093 094 095 096 097

RCL 8 RCL -4 g x2 + 6 f g ABS CT0 4 f LBL E f CLEAR GSB 1 g P/R f USER

+ 1

33

8

KEYSTROKES

REG

Instructions for Running Friedman’s Test

STEP

INSTRUCTIONS

1 2 3 4 5 6 7 8 9 10 11 12 13

Key in program (Table 5A) Clear registers-reset for entry of new data Enter ranks in treatment sequence by subject Reset after all treatments for each subject Repeat steps 3 and 4 for all subjects Calculate mean rank for each treatment Reset for entering ties or calculating x: Enter number of ties per each subject Repeat entry of ties for all subjects Calculate degrees of freedom Calculate (x:)~ for Friedman’s test Enter mean rank for first treatment Enter mean rank for second treatment and calculate q for difference Repeat steps 12 and 13 for all pairs

14

Calculator Programs

(cont. )

KEYSTROKES

TABLE 5B

Comparison

INPUT

KEYSTROKES

OUTPUl

E A B

0.0000

Rij

R/S R/S C C D R/S R/S R/S

i& 0.0000

t1 f”

R, R,

Rij Number of subject

t1 t, d.f.

I_xF)C Rl 9

* *

* Record these values for determining significant differences Notes: This program will perform comparisons of up to 11 different treatments of an indefinite number of subjects. Multiple comparisons are calculated by Tukey’s test and significance is determined by a table of studentized values (q). A display of “Error 0” at step 11 means that ranks were calculated or entered incorrectly. Correct before restarting at step 2. This program has no provision for correcting a wrong entry. One must return to step 2 (keystroke [El) and reenter all data. Steps 8 and 9 may frequently be skipped, as ties usually affect the value of xr’ very little. If errors are made or critical values not recorded beyond step 9, step 10 (keystroke [D]) and all subsequent steps may be repeated. Examples: Schefler (1979), pp. 223-224. Slight error in value of x: on p. 224. Problem 12.10 on p. 227 is solved correctly. The answer (p. A-30) provides the value of xr’ uncorrected for tied ranks. Sokal-Rohlf (1981), pp. 446-447; Steel-Torrie (1980), pp. 546-547; Zar (1984), pp. 228-231. This is the only reference that discusses multiple comparisons briefly but provides no example. The above program calculates mean ranks (step 6), which may be multiplied by n, the number of subjects, to yield the sums of ranks in the texts.

34

A. Wurwib! TABLE 6A STEP

Mann-Whitney

KEYSTROKES

STEP

g P/R f LBL A X+ R/S ST0 * 0 RCL 1 ST0 .I f CLEAR S R/S f LBL B z+ f LBL 1 R/S RCL 0 RCL -0 + ST0 2 ENTER

030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059

-

001 002 003 004 005 006 007 008 089 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029

g x2 + 2 t RCL I RCL .l + f xfy g SIN-’ RCL * 0 RCL 0 X

TABLE 66 STEP

Program for Ranked Data -

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

ST0 3 RCL .O

060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 087 082 083 084 085 086 087 088 089

IO"

090 091 092 093 094 095 096 097 098 099 100 101 102 103 704 105 106 107 108 109 110 111 112 113 114 115 116 117

v/x

g x2 RCL .O + 2 i + RCL .I ST0 RCL RCL f x>y xzy R/S x%-y R/S x@y 4 0 f x4y CT0 2 0

4 *0 0

2

g Rt f xsy CT0 3 f LBL 2 9

instructions for Running Mann-Whitney

l~sTR~mi0Ns

Key in program (Table 6A) Clear registers-reset for entry of new data Enter ranks from first group (a) Reset for next group Enter ranks from second group (b) Display number of samples in smaller 7 8a 8b 9b

1 R/S f LBL D RCL 4 RCL 3 2 ; _ g ABS 5 _ RCL 2 CSB 4 ST0 5 1 2 X

RCL ; RCL 1 + ; RCL RCL + +

3 2

5 6

:TO 1 f LBL4 ENTER ENTER 3 Y” xzy g RTN f LBL C GSB 4 CHS ST0 + 6 g LSTx R/S f LBL 3 RCL 3 RCL 4 RCL 4 f xsy XZ?Y

CT0 1 f LBL E f CLEAR REG f CLEAR Z g P/R f USER

U Test on Ranked Data INPUT

KEYSTROKES

OUTPUT

X a”

E A WS

Xbm

B

0.0~0 Number of entry 0.0000 Number of entry N<

group Display number of samples in larger group Display Mann-Whitney statistic, U if Nq and/or N2 exceeds limits of table, then Display prompt that table exceeded and normal distribution approximated Calculate value of Z * Record these values for determining significant differences Notes: This procedure calculates values of the Mann-Whitney

R/S

R/S R/S

N2

WS

999...

WS

Z

U

*

* t

*

statistic, U, as tabulated in the books

Multiple TABLE 6B

Comparison

Calculator Programs

(cont.)

by Zar (1984) and Rohlf and Sokal (1981). If the latter book is used, N, and N2 are reversed and the table is shorter. To compensate for these differences, the following keystroke substitutions in two steps may be made in the program in Table 6A: 043 [f] [xcy]; 049 [21. If calculated U exceeds value in table, then medians are significantly different. The tables in the books by Schefler (1979) and Siegel (1956) give the lower critical values for U. To use these books, substitute keystrokes [f] [x>y] at step 112 of table 6A. Then significance will be established by a value of U calculated at step 8a which is less than that in Siegel’s table or by the subsequent calculations indicated by Schefler (pp. 214-216). If Z is greater than 1.96, then medians are significantly different at p < 0.05. If the value at step 9b approaches but does not achieve significance, one may correct for tied ranks. Enter all sets of ties, following each set by keystroke [Cl; then keystroke [Dl will display the corrected Z. This procedure does not calculate T, the rank sum for the Wilcoxon-Mann-Whitney test provided in many books. The T and U tests arrive at similar levels of significance, but calculated critical values are totally different. Be careful to use the correct (U) table with the value calculated by procedure 66. Examples: Schefler (1979), pp. 214-216; Sokal-Rohlf (1981), pp. 433-435. Steel-Torrie (1980) does not discuss the U test. Instead, the T test is provided, which arrives at totally different critical values, as noted above. Zar (1984), pp. 138-143.

TABLE 7A

Mann-Whitney

Program

STEP

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

STEP

001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023

g P/R f LBL A 0 ST0 I f LBL 1 f x2(i) f x21 1 + fxzl f xz(i) gx=o CT0 3 f x>y GTO 2 CT0 1 f LBL 2 xsy CT0 1 f LBL 3 xsy f x2(i) RCL I ST0 ’ 3

024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047

R/S f LBL B RCL (i) f xzy CT0 4 RCL .4

048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071

RCL I + RCL .4 + ST0.4 RCL .3 ST0 I RCL ‘5 R/S f LBL C RCL .5 RCL .3 f x>y xzy R/S xsy R/S

072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091

5 + ST0 ‘4 RJ f LBL 4 xzy f x>y CT0 5 RCL I f DSE RJ CT0 B f LBL 5 RCL .5 1 + ST0 .5

X

ST0 1 RCL .5 g x2 RCL + 2

.5

KEYSTROKES

+

RCL _

.4

RCL 1 x2y g LSTx f xcy xsy R/S CT0 C f LBL D 0 ST0 ’ 4 ST0 ’ 5 R/S f LBL E f CLEAR REC f CLEAR P g P/R f USER

35

36

A. Hurwifz TABLE 7B SVP 1 2 3 4 5 6 7

lns~ru~ions for Running ~ann-whi~n~~

IN~TRU~~~~NS

Key in program (Table 7A) Clear registers-reset for entry of new data Enter data from first group (A) Enter data from second group (B) Display number of entries in smaller group Display number of entries in larger group Display larger lJ value for table

Program INPUT

X“a Xmb

KEYSTROKES

OUTPUT

E A B C R/S WS

0.0000 Number of entry Number of entry r% fG2

U

* *

*

* Record these values for determining significant differences Notes: This procedure calculates values of the Mann-Whitney statistic, U, as tabulated in the books by Zar (19841 or Rohlf and Sokal(?98~), If the latter book is used, N, and h$ are reversed and keystrokes M [x 6 y] should be substituted in step 060 of Tabfe 7A. If calculated U exceeds value in table, then medians are sigmficantly different. The tables in the books by Schefler (1979) and Siegel (1956) give the lower critical values for U. To use these books, substitute keystrokes Ifl Ix > yl at step 088 of Table 7A. Significance is established by a value of U calculated at step 7 which is less than that in Siegel’s table or by the subsequent ca~cuiations indjcated by Schefler (pp. 214-216). This procedure does not calculate T, the rank sum for the Wilcoxon-Mano-Whitney test provided in some other books. All values in first group (A) must be entered before entering any values from second group (B). If an error is made in entering the second group (81, keystroke (DJ will delete all data from this group so that it may be reentered correctly without entering group A. Group A is limited to 12 entries and should therefore be the smaller group if one group exceeds this number. If both groups have fewer than 12 entries, data entry would be speeded if the numerical values (or ranks) in second group (B) are greater than those of group A. Either ranks or raw data may be run by this program, which orders ranks as data are entered. Examples: Same as for Table 68.

strate how to rank data for the nonparametric tests in Tables 4-6. The programs in Tables 7 and 8 rank the data as they are entered. DISCUSSION Student t-test is a convenient, reliable test for determi#~ng whether or not two sample means are significantly different. It is misused when means of more than two groups are compared, especially if such comparisons were not planned, As pointed out by Steel and Torrie (1980, p. 1741, “When experimenters think they are making a t test at the 5 percent level, they are actually testing at the 13 percent level for three treatments, the 40 percent level for six treatments, and so on.” To correct for inappropriate conclusions based on such comparisons, it is widely recognized that one-way analysis of variance ~AN~VA~ should be done first to establish any significant di~ere~ces between means. Then pairwise comparison is j~dicated if the F test shows s~gnifi~a~~e. The choice of pairwise comparison test is controversial and is discussed in many statistics books Cichefler, 1979; Sokal and Rohtf, 2981; Steel and Torrie, 1980; Zar, 1984). Most statisticians will accept the procedures of Tukey, Newman-Keuls, or Duncan. The calculations for all these tests are similar; only the critical values in the tables and their applications are different. These computatio~s are straightfo~ard, but too complex and time consuming for hand-heid calculators, Software for computers is available for performing multiple compari-

Multiple TABLE 8A STEP

001

002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022

Wilcoxon Signed Ranks Program STEP

KEYSTROKES

STEP

KEYSTROKES

STEP

KEYSTROKES

g P/R f LBL A f xq GTO 0 xzy 0 ST0 I f LBL 1 f xs(i) f XH 1 + f XSl f x%z(i) g x=0 CT0 3 f x>y CT0 2 CT0 1 f LBL 2 x2y CT0 1

023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045

f LBL 3 xzzy f xs(i) RCL I ST0 .3 R/S f LBL 0 0 R/S f LBL B f x>y GTO 0 gx=o CT0 0 f LBL4 RCL (i) f x
046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068

f xzy CT0 6 RCL .4

069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089

RCL .5 R/S f LBL C + ST0 1 f LBL 7 RCL 1 R/S ENTER

9 10 11

5 + ST0 .4 f DSE RS RCL (i) CT0 5 f LBL 6 RCL .5 1 + ST0 .5 RCL I + RCL .4 + ST0 .4 RCL .3 ST0 I

g x2 + 2 2 RCL .4 RIS R/S CT0 7 f LBL E f CLEAR REC f CLEAR Z g P/R f USER

Instructions for Running Wilcoxon Signed Ranks Program

INSTRUCTIONS Key in program (Table 8A) Clear registers-reset for entry of new data Enter first member of pair A, (x1 < x2) Enter second member of pair A, Repeat steps 3 and 4 for all pairs in which

6 7 8

Calculator Programs

KEYSTROKES

TABLE 8B STEP

Comparison

x1 < x2 Enter first member of pair B, (x1 > x2) Enter second member of pair Bj Repeat steps 6 and 7 for all pairs in which x1 ’ Display Display Display

x2 total number of pairs sum of ranks in group B sum of ranks in group A

INPUT

KEYSTROKES OUTPUT

E ENTER A

0.0000

XIA x2A

X16 x26

ENTER B

X16

C RIS RIS

%A Number of pairs

Number of pairs

Total pairs T+ T-

* * *

* Record these values for determining significant differences Notes: All A pairs (x, < x2) must be entered before any B pairs in order to compute correct rank sums. If A pairs are keyed in with keystroke [Bl or vice versa, 0.0000 will be displayed without affecting the calculations. This program will accept up to 12 pairs in the smaller (A) group. If the number of pairs in A (x, < x2) exceeds 12, and B has 12 pairs or fewer, rank sums can be computed by entering x2.swith keystroke [ENTER] and then xqBwith [Al, and making the corresponding switches when entering all other pairs. Examples: Schefler (1979), not discussed; Sokal-Rohlf (1981), p. 448; Steel-Torrie (1980), pp. 539-540. Zar (1984), pp. 153-155.

37

38

A. Hun&z

sons. Although computers are commonplace, they are still costly and bulky, and statistical programs are quite expensive. Another situation for which t-tests are inappropriate occurs when data are not distributed normally (as in tail-flick analgesia determinations) or when variances differ widely. Under these circumstances nonparametric tests are preferable. One advantage of nonparametric tests, relative ease of computation, is lost when applying the programs in the present paper. The need for prior ranking (Tables 4-6) or slowness of data entry (Tables 7 and 8) actually make the nonparametric tests less convenient. However, since parametric tests may not always be appropriate for comparisons of groups, programs for nonparametric tests are provided in this paper. Several monographs, such as that of Abramson and Peritz (1983) and the report of Mizsei (1985), list calculator programs for a limited number of statistical tests. These require machines with much greater programming and memory capability. Such calculators, with card readers and printers, are quite expensive. Hewlett-Packard has recognized the usefulness of the HP-IIC for statistical analyses and has provided programs for t-tests and the chi-square test in the owner’s manual. However, these tests are inadequate for multiple comparisons. The programs in the present paper, designed to run on this very inexpensive machine, make a wide array of tests readily available to nearly all students and investigators. This work was supported by American Heart Association Grant KS-85-G-23 from the American Association, Kansas Affiliate and U.S. Public Health Service Grant DA 02477.

Heart

REFERENCES JH, Peritz E (1983) Calculator Programs Sciences. New York: Oxford University Press.

Abramson

for the Health

Godfrey K (1985) Comparing the means of several groups. N Engl j Med 313:1450-1456. Hollander tistical

M, Wolfe DA (1973) Nonparametric Methods. New York: John Wiley

Siegel S (1956) Nonparametric Statistics for the Behavioral Sciences. New York: McGraw-Hill.

Sta-

Sokal RR, Rohlf FJ (1981) Biometry, Francisco: WH Freeman.

and

Steel RGD, Torrie JH (1980) Principles

Sons.

dures

Longnecker DE (1982) Support versus illumination: trends in medical statistics. Anesthesiology 57: 73-74.

15~225-235. Tables,

2nd ed.

of Statistics:

A Biometrical

2nd

ed. San

and Proce-

Approach,

2nd

ed. New York: McGraw-Hill.

Winer BJ (1971) Statistical Design,

Mizsei I (1985) Pocket calculator program of oneway analysis of variance. Comput Biol Med Rohlf FJ, Sokal RR (1981) Statistical San Francisco: WH Freeman.

Schefler WC (1979) Statistics for the Biological Sciences, 2nd ed. Reading, MA: Addison-Wesley.

Principles

in fxperimental

2nd ed. New York: McGraw-Hill.

Zar JH (1984) Biostatistical Analysis, wood Cliffs, NJ: Prentice-Hill.

2nd ed. Engle-