
                               UPDATE (part 2)
                               ~~~~~~~~~~~~~~~
                               
         The main changes since publication of the manual for PEPI 
         version 2 are described below.  These apply to CASECONT, 
         COMBINE, CONFINT, DIFFER, KAPPA, MANNWHIT, MATCHED, PAIRS, 
         PVALUE, RATES1, RATES2, SCRN, SEASONAL and WHATS.  
         
         Supplementary references are listed in part 3 (UPDATE3.TXT).

         ----------------------------------------------------------------

         CASECONT
         ~~~~~~~~ 
         Options for the DerSimonian-Laird procedure and for computing 
         the exact power of exact tests have been added. 
         
         Version 2.01 adds the DerSimonian-Laird procedure (DerSimonian 
         and Laird 1986) for computing an overall odds ratio based on 
         stratified data, using a random-effects model. This may be 
         helpful in meta-analyses based on studies with heterogeneous 
         results (Fleiss and Gross 1991, Petitti 1994, Whitehead and 
         Whitehead 1991).  Unlike the usual fixed-effect model (Mantel-
         Haenszel procedure, etc.), which assumes that the studies 
         provide estimates of the same true effect, the random-effects 
         model assumes that they estimate randomly differing effects.  
         The variation between studies is taken into account, resulting 
         in wider confidence intervals and a more conservative 
         significance test.  The procedure may be inappropriate if sample 
         sizes are very small.  
         
         Version 2.04 adds an option for computing the exact power of 
         exact Fisher and mid-P tests for comparing two independent 
         binomial distributions.  It computes conditional and expected 
         power for these tests.  Conditional power is dependent on all 
         four marginal totals, and may be appropriate when these are 
         known.  Expected power (Casagrande, Pike and Smith 1978), also 
         termed overall, average or unconditional power (Bennett and Hsu 
         1960, Hirji et al. 1994), is appropriate when a study is being 
         designed; it requires knowledge of the sizes of the two samples, 
         but allows for the probability of different numbers with the 
         attribute under study.  The program can also be used to 
         determine the sample sizes required for an exact test, by 
         entering different sample sizes in a series of trial-and-error 
         estimations of expected power (Hirji et al. 1994). 
                                                  
         When computing power, the program uses the 2x2 table that is 
         entered (see Manual, p. 33) to determine the sample sizes and 
         (if conditional power is required) the other marginal totals. 
         For expected power, the table must provide correct sample sizes; 
         for conditional power, it must also provide correct totals with 
         and without the attribute; the entries in the body of the table, 
         however, can be fictional.  The odds ratio that it is wished to 
         detect (which is ad/bc) can be entered or (optionally) 
         determined from the entries in the body of the table.             
         
         Power computation is based on the sizes of the samples, the 
         significance level (alpha) and the odds ratio that it is wished 
         to detect.  Power is computed for a two-tailed test, where P = 
         twice the smaller one-tailed P; to compute the power of a one-
         tailed test with alpha = 0.05, an alpha of 0.1 must be entered.  
         
         Conditional power is dependent on the sample sizes, alpha, the 
         odds ratio, and the total number with the attribute ("exposed") 
         under study.  The odds ratio may be more or less than 1.  The 
         program reports the actual alpha to which each power calculation 
         pertains; this may be considerably less than the nominal alpha, 
         because the distribution is stepwise (Bennett and Hsu 1960, 
         Casagrande et al. 1978a).  The critical number of "exposed" 
         cases or controls is reported; if this is decreased by 1, P 
         exceeds the nominal alpha.  

         Expected power is computed from the sample sizes, alpha, the 
         odds ratio to be detected, and the assumed proportion with the 
         attribute ("exposed") in the population represented by the 
         second sample ("controls").  The latter proportion must be 
         entered.  The program cannot compute expected power if the odds 
         ratio is <1, i.e., if the percentage of "exposed" is assumed to 
         be higher in the "controls" than in the "cases". It may be 
         necessary to transpose and re-label the "cases" and "controls" 
         for this purpose. 
                                         
         If an odds ratio of 1 is entered, the computed power is the 
         "true" type I error (Casagrande et al. 1978b). 
         
         The computation of exact probabilities and exact confidence 
         intervals for odds ratios for stratified data is now much 
         faster, because of the employment (Version 2.02) of a more 
         efficient algorithm for calculating the coefficients of the 
         conditional distribution (Martin and Austin 1991, 1996), using 
         code from David O. Martin's public-domain EXACTBB program. 
         
         Formulae: 
         
         The Dersimonian-Laird procedure described by Fleiss and Gross 
         (1991) is used.  For this purpose the log odds ratio for each 
         stratum, and its standard error, are computed after adding 0.5 
         to each cell in the 2x2 table (Fleiss 1981: 165-166); the Q 
         statistic, which plays a central role in the analysis, is based 
         on these results and (as suggested by Petitti (1994: 111-113) 
         the Mantel-Haenszel estimate of the common odds ratio; 90, 95 
         and 99% confidence intervals are displayed; chi-square is 
         sqr(DL/se), where DL is the DerSimonian-Laird estimator and se 
         is its standard error.  If Q + 1 is less than the number of 
         strata the random-effects and fixed-effect models yield 
         identical results. 
         
         Formulae for conditional power are provided by Casagrande,
         Pike and Smith (1978) and Andres and Tejedor (1995, formula
         6), and for expected power by Casagrande, Pike and Smith
         (1978) and Bennett and Hsu (1960).  The accuracy of expected
         power computations has been checked against a program (Hirji
         et al. 1994) kindly provided by Prof. S.E. Vollset.

         COMBINE
         ~~~~~~~
         Version 2.01 provides an option for the entry of 90, 95 or 99% 
         confidence limits of measures to be combined, instead of the
         standard errors of the measure or its log. The standard error
         is computed from the confidence interval.
         
         Version 2.01 also adds the DerSimonian-Laird procedure 
         (DerSimonian and Laird 1986) for computing an overall measure of 
         association, using a random-effects model.  The measure may be a 
         difference between rates, proportions or means (or some other 
         measure with an approximately normal distribution and a value of 
         zero when there is no association) or an odds or rate ratio (or 
         some other measure whose log has an approximately normal 
         distribution and a value of zero when there is no association).  
         The standard errors of the measures or their logs, or the 
         confidence intervals of the measures, must be entered.  
         
         The DerSimonian-Laird procedure may be helpful in meta-analyses 
         based on studies with heterogeneous results (Fleiss and Gross 
         1991, Petitti 1994, Whitehead and Whitehead 1991).  Unlike the 
         fixed-effect model (used in computing the precision-based 
         overall measure), which assumes that the studies provide 
         estimates of the same true effect, the random-effects model 
         assumes that they estimate randomly differing effects. The 
         variation between studies is taken into account, resulting in 
         wider confidence intervals and a more conservative significance 
         test.  The procedure may be inappropriate if sample sizes are 
         very small.  
         
         An option for the computation and combination of effect sizes 
         (standardized differences between two means) was added in 
         version 2.01.  The effect size is defined as the difference 
         between the means, divided by the pooled standard deviation 
         (which the program computes from the sample sizes and stanadard 
         deviations).  Being "unitless", this measure of association has 
         been used for combining the results of studies that use 
         different measurement scales; but, as pointed out by Greenland 
         (1987), Petitti (1994: 123) and others, the measure may be 
         misleading.  
         
         As a rough guide to the meaning of the overall effect size, the 
         program displays the approximate percentage of members of one 
         group who have values below the mean of the other group (Glass 
         et al. 1981: 29), based on the assumption that the population 
         variances in the two groups are equal.  An odds ratio (added in 
         Version 2.02) is computed as an additional aid to the 
         interpretation of the effect size.  This expresses the accuracy 
         with which individuals might be allocated to the two groups on 
         the basis of likelihood ratios derived from a comparison of the 
         distributions, using an arbitrary cutting point.  It is the 
         ratio of the odds in favour of correctly classifying members of 
         either one of the groups to the odds in favour of incorrectly 
         classifying members of the other group.  
                                                          
         Formulae: 
         
         The random-effects procedure of Dersimonian and Laird (1986) is 
         used.  Zero odds and rate ratios are changed to 0.00001. The Q 
         statistic, which plays a central role in the analysis, is based 
         on the data for separate strata and the precision-based estimate 
         of the common measure.  If Q + 1 is less than the number of 
         strata the random-effects and fixed-effect models yield 
         identical results.  Results may differ slightly from those 
         provided by CASECONT, RATES1 and RATES2, which use the Mantel-
         Haenszel estimate of the common measure, not the precision-based 
         estimate. 
        
         The analysis of effect sizes follows the lines described by 
         Petitti (1984: 119-123).  The pooled standard deviations 
         (assuming equal population variances) and the approximate 
         variances of the effect sizes are computed by formulae from 
         Hedges and Olkin (1985: 79, 80).  The formula for the odds ratio 
         (based on Tritchler 1995) is: 
                        Odds ratio = sqr[a / (1 - a)]
         where a = 1 - P
         P = one-tailed probability for Z (standardized normal deviate)
         Z = |Effect size| / 2

         CONFINT
         ~~~~~~~
         The confidence intervals computed by Zar's formulae (Manual, pp. 
         60-61) based on the F distribution (Brownlee 1965) may now be 
         regarded as exact (Fisher's) intervals, because of the use in 
         Version 2.01 of a more accurate inverse F distribution function.  
         These formulae are now used for denominators exceeding 30,000 in 
         Options A and C and (if the sum of the two numbers entered 
         exceeds 50) in Options E and G; these options can now handle 
         very large numbers.  Zar's formulae can also be selected as an 
         option for smaller denominators, by pressing 'F' after choosing 
         Option A or C. 
         
         Approximate mid-P intervals for proportions and rates (Options A 
         and C) are now computed (Version 2.03) in those instances where 
         exact mid-P intervals are not provided -i.e., for denominators 
         of over 30,000 or (if the numerator is zero) over 15,000. 
         
         Formulae:
         
         The program uses Vollset's formulae for "a closed form 
         approximation to the mid-P exact interval" (Vollset 1993). The 
         formulae for proportion x/N are: 
                 Lower limit[x] = (LF[x] + LF[x+1] / 2 
                 Upper limit[x] = (UF[x] + UF[x-1] / 2 
         where LF and UF are the lower and upper Fisher's limits. Vollset 
         found that this method, "proposed to provide an easily computed 
         alternative to the mid-P interval, has a level of 
         conservativeness in between the mid-P and uncorrected score 
         method".  For large denominators the intervals are almost 
         identical to the true mid-P values. 
         
         For Vollset's procedure, LF[x] and UF[x] are computed by Zar's 
         formulae, and LF[x+1] and UF[x-1] either by Zar's formulae or by 
         Pratt's approximation to the exact method (Blyth 1986).  The 
         Pratt method is suggested by Vollset, who refers to these 
         approximate mid-P intervals as "mean Pratt" intervals. The 
         program uses Zar's formulae for proportions with a numerator 
         less than 50, rates with a base of 10 or 100 and a numerator 
         less than 50, rates with a base of 1,000 and a numerator less 
         than 100, rates with a base of 10,000 and a numerator less than 
         500, and rates with a base of 10,000 or more and a numerator 
         less than 700. Pratt's faster method is used in other instances, 
         when it provides identical results to Zar's method, at the level 
         of precision with which the program displays results. 

         DIFFER
         ~~~~~~
         Version 2.05 provides an option for estimating the effect of 
         regression to the mean (RTM), for use in a before-after 
         comparison of two measurements in a sample selected because of 
         its extremely high or extremely low initial values (i.e., above 
         or below a given cut-off point, according to the "before" 
         measurement or the mean of two or more "before" measurements).  
         In a trial, the RTM effect may be confused with a treatment or 
         placebo effect.  The computation assumes a bivariate normal 
         distribution in the base population (from which the sample is 
         selected); it requires the mean, standard deviation, and 
         correlation between measurements on the two occasions (in this 
         whole population).  Allowance can be made for changes in the 
         population mean or standard deviation between the two occasions, 
         e.g. as a result of aging.  

         Formulae:

         The methods are described by Yudkin and Stratton (1996); the 
         adjustments to allow for changes in the population mean or 
         standard deviation are described by Chinn and Heller (1981). 

         KAPPA 
         ~~~~~ 
         For comparisons of two ratings, Version 2.04 provides BAK 
         (bias-adjusted kappa) and PABAK (prevalence-adjusted bias-
         adjusted kappa) (Byrt et al. 1993), and (for dichotomous scales) 
         the overall percentage agreement and the percentage agreement 
         for each category (Cicchetti and Feinstein 1990) and indices of 
         bias and skewed prevalence.  
         
         The adjusted values are conditional on the observed percentage 
         agreement.  BAK is the value that kappa would take if there were 
         no systematic one-sided variation between the ratings; it is 
         equivalent to Scott's pi coefficient of agreement (Scott 1955).  
         Low kappa values may be affected by bias.  PABAK is the value 
         that kappa would take if, in addition, the prevalence of each 
         category (as expressed by the mean of the two raters' totals 
         for the category) was equal.  PABAK may be useful in appraising 
         agreement when the percentage agreement is high and kappa is 
         paradoxically low; it approximates to the highest possible kappa 
         if the percentage agreement is above about 50% (Lantz and 
         Nebenzahl 1996).  PABAK is called kappa-nor by Lantz and 
         Nebenzahl (1996), and is equivalent to Maxwell's RE (random 
         error) coefficient of agreement (Maxwell 1977) and Bennett's S 
         coefficient (Bennett et al. 1954).  The bias index and skewed-
         prevalence index are the indexes of symmetry in disagreement and 
         agreement proposed by Lantz and Nebenzahl (1996).  The measures 
         of percentage agreement are uncorrected for chance agreement. 
                   
         Formulae:

         For a dichotomous scale:

           Percentage agreement = PA x 100, where PA = ad/n
           Percentage agreement for category 1 = 200a / (2a + b + c)
                                for category 2 = 200d / (2d + b + c)
           For BAK, b and c are equalized before computing kappa: 
             modified b = modified c = (b+c) / 2;
           PABAK = 2.PA - 1; 
           Bias index = 100(|b - c|) / (b + c) 
           Skewed-prevalence index = 100(|a - d|) / (a + d) 

           where a and d are the numbers of concordant ("Yes-Yes" and 
                         "No-No") pairs  of ratings
                 b and c are the numbers of discordant pairs 
                 n = a+b+c+d

         For a polychotomous scale:

           For BAK, all "mirror-image" pairs are equalized: if f is the 
             number rated as X by one rater and Y by the other, and g is 
             the number rated as Y by the first rater and X by the other, 
             modified f = modified g = (f+g) / 2. 
           For PABAK, all the row totals and columns totals are also 
             equalized (making their value n/k, where n = the total 
             number of pairs and k = the number of categories); this is 
             done by modifying the concordant values, whose total remains 
             unchanged.  A warning is displayed if a negative concordant 
             value is needed.  A short-cut formula is used: 
                      PABAK = ([PA.k] - 1) / (k - 1)

         MANNWHIT
         ~~~~~~~~
         An error in the handling of zero and negative values entered in 
         the Wilcoxon test has been corrected (Version 2.04). 
         
         MATCHED
         ~~~~~~~
         Exact probabilities and exact confidence intervals for odds 
         ratios are now computed (Version 2.03).  The computation uses an 
         efficient algorithm for calculating the coefficients of the 
         conditional distribution (Martin and Austin 1991, 1996), using 
         code from David O. Martin's public-domain EXACTBB program. 
         
         PAIRS
         ~~~~~
         Exact Fisher's and mid-P probabilities and confidence intervals 
         for odds ratios are now computed (Version 2.03) for single 
         samples of matched pairs (option D) and for the pooled data of a 
         set of samples (option X).  The computation uses an efficient 
         algorithm for calculating the coefficients of the conditional 
         distribution (Martin and Austin 1991, 1996), using code from 
         David O. Martin's public-domain EXACTBB program. 
         
         PVALUE
         ~~~~~~
         Since the inverse F distribution function used by PEPI is less 
         accurate than the F distribution function, its accuracy was 
         enhanced (in Version 2.01) by adapting its results to those of 
         the latter function.  After initial estimation of F from P (in 
         Option V), the corresponding P value is back-estimated from F, 
         and the F value is increased or decreased until its 
         corresponding P coincides with the entered P value.  If the 
         numerator degrees of freedom = 1, an accurate F value is 
         calculated from the t distribution by the formula 
                             F = sqr(t[P/2,DF2]), 
         where DF2 = denominator degrees of freedom (Diem 1970: 167).

         The modified function is also now used in COMBINE and PAIRS.
         
         RATES1
         ~~~~~~
         Version 2.01 adds the DerSimonian-Laird procedure (DerSimonian 
         and Laird 1986) for computing an overall rate ratio based on 
         stratified data, using a random-effects model.  This may be 
         helpful in meta-analyses based on studies with heterogeneous 
         results (Fleiss and Gross 1991, Petitti 1994, Whitehead and 
         Whitehead 1991).  Unlike the usual fixed-effect model (Mantel-
         Haenszel procedure, etc.), which assumes that the studies 
         provide estimates of the same true effect, the random-effects 
         model assumes that they estimate randomly differing effects.  
         The variation between studies is taken into account, resulting 
         in wider confidence intervals and a more conservative 
         significance test.  The procedure may be inappropriate if sample 
         sizes are very small.  
         
         Formulae: 
         
         The random-effects procedure of Dersimonian and Laird (1986) is 
         used.  For this purpose the log rate ratio for each stratum, and 
         its standard error, are computed after changing any zero rate to 
         0.0001/Base (where Base = 1,000 or whatever other base is used 
         for the rates); the formula used for the SE of the log rate 
         ratio is 
             sqrt[(1 - RateA) / (A x RateA) + (1 - RateB) / (B x RateB)].
         The Q statistic, which plays a central role in the analysis, is 
         based on the data for separate strata and the Mantel-Haenszel 
         estimate of the common rate ratio.  This option is not offered 
         if the attributable-fraction option has been selected.  If Q + 1 
         is less than the number of strata the random-effects and fixed-
         effect models yield identical results.  
        
         RATES2
         ~~~~~~
         Version 2.01 adds the DerSimonian-Laird procedure (DerSimonian 
         and Laird 1986) for computing an overall rate ratio based on 
         stratified data, using a random-effects model.  This may be 
         helpful in meta-analyses based on studies with heterogeneous 
         results (Fleiss and Gross 1991, Petitti 1994, Whitehead and 
         Whitehead 1991).  Unlike the usual fixed-effect model (Mantel-
         Haenszel procedure, etc.), which assumes that the studies 
         provide estimates of the same true effect, the random-effects 
         model assumes that they estimate randomly differing effects.  
         The variation between studies is taken into account, resulting 
         in wider confidence intervals and a more conservative 
         significance test.  The procedure may be inappropriate if sample 
         sizes are very small.  

         The computation of exact probabilities and exact confidence 
         intervals for rate ratios for stratified data is now much 
         faster, because of the employment (Version 2.02) of a more 
         efficient algorithm for calculating the coefficients of the 
         conditional distribution (Martin and Austin 1991, 1996), using 
         code from David O. Martin's public-domain EXACTBB program. This 
         method is also used for computing exact probabilities in single 
         strata where the sum of the two numerators exceeds 30,000. 
         
         Formulae: 
         
         The random-effects procedure of Dersimonian and Laird (1986) is 
         used.  For this purpose the log rate ratio for each stratum, and 
         its standard error, are computed after changing any zero rate to 
         0.0001/Base (where Base = 1,000 or whatever other base is used 
         for the rates). The Q statistic, which plays a central role in 
         the analysis, is based on the data for separate strata and the 
         Mantel-Haenszel estimate of the common rate ratio. This option 
         is not offered if the attributable-fraction option is selected.  
         If Q + 1 is less than the number of strata the random-effects 
         and fixed-effect models yield identical results. 

         SCRN
         ~~~~
         Version 2.01 displays a ROC (receiver operating characteristic) 
         curve for tests that provide a range of values. The curve shows 
         the association between sensitivity and the false positive rate 
         (100% minus specificity %).  The point on the curve closest to 
         the top left corner of the graph is the point where the sum of 
         sensitivity and specificity is highest. The closer this point is 
         to the top left corner, the better the test (assuming that false 
         negatives and false positives are equally important) (Sackett et 
         al. 1985: 106-107).  
         
         Confidence bounds are estimated for the ROC curve, using the 
         method described by Schaefer (1994), based on a statistical test 
         introduced by Greenhouse and Mantel (1950).  These are pointwise 
         95% bounds, computed for each of the cutting-points for which 
         data are entered; they take account of the variability in both 
         samples (diseased and nondiseased individuals).  Strictly 
         speaking, they are valid only if the specificity of interest has 
         been stipulated in advance, and may be misleading if a search 
         for an appropriate cutting-point is performed along the whole 
         ROC curve; however, "in practice, in most clinical decision 
         situations a range of relevant specificities (or sensitivities) 
         will at least be restricted to a region of interest which can be 
         defined before inspection of the data" (Schaefer 1994). The 
         confidence bounds may be inaccurate if the samples are small; 
         the program computes them only if the size of each sample is 
         between 20 and 2,000.  
                                                                      
         The computation of confidence bounds for the ROC curve is based 
         on source code written by Prof. H. Schaefer, to whom we are 
         grateful for his consent to its use. 

         SEASONAL
         ~~~~~~~~
         Hewitt's rank-sum test for a 6-month peak (Hewitt et al. 1971), 
         extended to 4- and 5-month peaks (Rogerson 1996) was added in 
         version 2.05. This is a conservative test based on the ranks of 
         the monthly numbers of events. The length of the hypothesized 
         peak period should be specified in advance.

         Formulae:

         Hewitt's statistic is the highest of all possible rank sums 
         based on consecutive periods of the designated length. Tied 
         ranks are reduced by first adjusting the monthly frequencies 
         according to the length of the month and any correction factors 
         entered; if ties occur, an average rank is used (Walter 1980).  
         The program uses exact significance levels provided by Walter 
         (1980) and Rogerson (1996), with interpolation for non-integer  
         values (Walter 1980). 

         WHATS
         ~~~~~
         The factorial function was extended in version 2.01.  Factorials 
         can now be computed for positive numbers up to 1,754.  Also, 
         factorials are displayed for fractional numbers; these may be 
         helpful if gamma functions are required, since the factorial of 
         any positive number x may be taken as the gamma function at 
         point (x + 1) (Hoel 1984: 88; Abramowitz and Stegun 1970: 255).  
         
         Options for the computation of permutations and combinations 
         were added in Version 2.03.  The program can compute these if 
         the total number of items in the set is up to 1,754.  
         
         The factorial n! is the number of possible arrangements of n 
         items; e.g., if there are three items (a, b and c), 3! = 6 
         arrangements are possible (abc, acb, bac, bca, cab and cba). The 
         number of possible subsets of r items (ignoring their 
         arrangement) drawn from a set of n items is comb(n,r); for 
         example, if n=3 and r=2, there are comb(3,2) = 3 possible 
         subsets (a and b, a and c, and b and c); comb(n,r) is the 
         binomial coefficient ('n over r' or 'n binomial r'). The number 
         of possible arrangements of a sub-set of r items drawn from a 
         set of n items is perm(n,r); for example, if n = 3 and r = 2, 
         there are perm(3,2) = 6 possible arrangements (ab, ac, ba, bc, 
         ca and cb). 

         Formulae:
         
         The program now uses Brenner's algorithm (Ball 1978:215) to 
         compute factorials for numbers up to 275 and Stirling's 
         approximation (Rothman and Boice 1982: 26) for larger numbers. 
         (We are grateful to Ray Simons for bringing Brenner's procedure 
         to our notice). 
         
         The formulae for permutations and combinations are:
                   perm(n,r) = n! / (n-r)!
                   comb(n,r) = perm(n,r) / r! 
                   
         ----------------------------------------------------------------

