Program documentation for CONTRAST : a general program
for the analysis of several survival or recovery rate
estimates.
James E. Hines, Patuxent Wildlife Research Center, U.
S. Fish and Wildlife Service, Laurel, MD 20708
John R. Sauer, Patuxent Wildlife Research Center, U. S.
Fish and Wildlife Service, Laurel, MD 20708
Introduction:
Several statistical procedures have recently become available
for the estimation of rates of survival and recovery from
banding and band recovery data for animal populations (e.g.,
White 1983, Conroy and Williams 1984, Brownie et al. 1985).
In spite of the sophistication of these models, there has
been comparatively little discussion regarding tests for
multiple comparisons of these rates, and the standard method
remains the z-test discussed by Brownie et al. (1985). Sauer
and Williams (1989) recently described a general procedure
for the comparison of several rate estimates that incorporates
associated variance and covariance estimates. The method
requires matrix multiplication and inversion, which may
limit its use among biologists.
In this user's manual, we describe a computer program
to implement the methods of Sauer and Williams (1989). We
also provide some guidelines for its use in multiple comparisons
of rate data, and illustrate the use of the program with
several examples. We discuss the method and its application
using survival rates (denoted by the symbol s), as we believe
that the program will be used primarily for the analysis
of survival rates. However, the method can be used for tests
about any rates (or other parameters) for which estimates
and their associated variances and covariances are available.
An expanded version of this user's manual (Hines and Sauer
1989) can be obtained from the authors.
Multiple comparisons of rate estimates. Brownie et al.
(1985) discussed a z test for comparison of survival rates,
which tests a simple hypothesis of form:
Ho: c1s1 + c2s2 + c3s3 + . . . + cnsn =0,
where the c1, c2, . . . , cn comprise a contrast., a series
of constants with the constraint that the sum of the ci
= 0. Most commonly, the ci are used to categorize the survival
rates into 2 groups, which then are tested using a z-test.
If the null hypothesis is true, z is asymptotically a standard
normal variate and critical values can be found in many
statistical texts (e.g., Snedecor and Cochran 1980).
The z-test is widely applicable to a variety of hypotheses,
in that simple contrasts can be used to specify groupings
of survival rates. However, it is more difficult to specify
the contrasts for composite hypotheses, such as a test for
differences among >2 groups of survival rates. The z test
is limited to separate tests defined by the selection of
a single contrast. Composite hypothesis of form:
Ho : s1 = s2 = s3 = . . . = sn,
with n > 2, cannot be specified by a single contrast.
To test this composite hypothesis, Sauer and Williams (1989)
suggested an asymptotically chi-square quadratic form.
For the composite hypothesis, the null hypothesis is rejected
with probability if the observed chi-square is greater than
a tabular critical value of chi-square with degrees of freedom
determined by the choice of the contrast matrix C (for the
simple hypothesis, df = n - 1) and significance level alpha.
Computation of the Contrast Matrix C
The hypothesis to be tested is determined by the structure
of matrix C. In general, C is composed of n - 1 algebraically
independent rows (i.e., it is of full rank), each of which
specifies a contrast. To test the hypothesis (3), we use
a matrix of dimension n - 1 x n with elements:
ci,j = 1 - 1/n for i = j,
= - 1/n for i not= j.
In the above, each row of the matrix is a contrast that
defines a simple hypothesis to compare the survival rate
corresponding to element (1 - 1/n ) to all other survival
rates (corresponding to elements -1/n). However, any grouping
of contrasts can be used to form the rows of C, and the
same computed value for the chi-square test will be produced,
as long as C is a full-rank matrix. If the overall hypothesis
is rejected, at least one of the survival rates differ from
the others.
In general, we can also test any simple hypothesis using
the chi-square test. The c's can be used to group the survival
rates into 2 categories, which can then be tested using
the chi-square test with C = [c1, c2 , . . . , cn ]. Note
that the C used in this test is a vector (i.e., it only
contains 1 row). The resulting chi- square is tested using
df = 1. The matrix C therefore can be used to test both
simple hypotheses and composite hypotheses, that require
several constrasts to specify. In CONTRAST, we provide the
option of defining a single contrast, and also allow specification
of groupings of >2 mean survival rates for testing of composite
hypotheses.
In Analysis of Variance procedures, there are many a-priori
and a-posteriori methods of specifying which group means
differ from the remaining means (Snedecor and Cochran 1980,
Neter and Wasserman 1974). Many of these methods use contrasts
to place the means into groups for testing for differences
as in simple hypotheses. In the case of survival rates,
we also use contrasts to construct simple hypothesis tests,
and we here provide some quidelines for multiple comparisons
of survival rates after the overall hypothesis (3) is rejected.
A-priori Tests: As in ANOVA-based multiple comparison
tests, it is often of interest to examine additional simple
or composite hypothesis that were defined before the overall
test was conducted. Although CONTRAST can be used to specify
any combination of contrasts, it is important to note that,
for a-priori tests of simple hypotheses to be independent,
the contrasts to be tested must be orthogonal. If the contrasts
are not orthogonal, the Chi-square value for the composite
test based upon the 2 contrasts will not be equal to the
sum of the Chi-square values from the separate tests. If
the contrasts are orthogonal, however, the composite Chi-square
can be partitioned into the Chi-square values of the simple
hypotheses.
A-posteriori Tests: It is often the case that "unplanned"
comparisons become necessary after the original test is
conducted. While these tests are legitimate to conduct,
some sort of adjustment of the alpha levels is necessary
to maintain the overall level of experimentwise error (Neter
and Wasserman 1974). We use the Bonferroni approach of using
alpha/m as the significance level for the unplanned comparisons,
where m is the number of contrasts tested. We leave it to
the user to appropriately modify significance levels for
both unplanned comparisons and one-sided tests.
Program specifications
CONTRAST was written on an IBM PS/2 using the Ryan McFarland
FORTRAN compiler (and the 8087 emulator library), so the
math coprocessor is not required. The program should run
on all IBM-PC compatible computers. The program currently
is set up to compare up to 50 survival rates, and takes
up less than 256K of memory. However, the size of the program
depends upon the maximum number of survival rates. For those
who have a FORTRAN77 compiler, the maximum number of survival
rates can be decreased or increased by changing all occurrences
of 'IDIM=50' to 'IDIM=XX' in the source code, where XX is
the desired number of survival rates.
Use of the Program
As an introduction to the use of the program, we will
present the responses to a simple application. We want to
first test the null hypothesis that 3 survival rates are
equal, then test the hypothesis that the first survival
rate is equal to the mean of the second and third survival
rates.
Sample Data:
S' = [ 0.25 0.30 0.35 ] =
[ 0.0002500 0 0 ]
[ 0 0.000625 0 ]
[ 0 0 0.000100 ]
For the overall Chi-square:
C =
[ 2/3 - 1/3 - 1/3 ]
[ - 1/3 2/3 - 1/3 ]
Chi-square = 6.80, 2 degrees of freedom (reject Ho, P < 0.035).
For the test of Ho: s1 = (s2 + s3)/2 :
C = [2 -1 -1]
Chi-square = 2.08, 1 degree of freedom (do not reject
Ho, P > 0.14).
Responses and data to be entered are enclosed by carrots
<>. The right carrot indicates use of the return (or enter)
key. Comments are delimited by pound (#) symbols.
To run the program, enter the name CONTRAST at the prompt.
It will respond with:
Program CONTRAST [07/17/89]
Tests hypotheses about survival or recovery rates.
Method: See Sauer & Williams (1989) Generalized Procedures
For Testing Hypotheses About Survival Or Recovery Rates.,
J. Wildl. Manage. 53:137-142.
Results from this program will be saved in a file called CONTRAST.OUT.
If the survival rates and variance-covariance matrix are entered
via the keyboard, they will be saved in a file called CONTRAST.TMP.
This file may be used as input to CONTRAST in later runs.
Enter input filename("CON" for keyboard input):<CON>
#If a filename was entered at this line, the program #
#would have taken all later data input and any #
#additional input (e.g., contrasts) from the file. #
#After all data are read from this input file, the #
#program reverts to interactive input. #
#Sample input file for this example: #
#EXAMPLE DATA #
#3 #
#2 #
#.25 #
#.30 #
#.35 #
#.0025 #
#0,.000625 #
#0,0,.0001 #
#1 #
#1,2,2 #
#2 #
#2,-1,-1 #
Enter title to identify contrast:
:<EXAMPLE DATA>
Enter number of survival rates(N):<3>
Enter 1 if you will be entering standard errors,
or 2 if you will be entering the variance-covariance matrix.
#Here is sample input for choice 1.#
Choice (1 or 2):<1>
Enter S,SE( 1):<.25,.05>
Enter S,SE( 2):<.30,.025>
Enter S,SE( 3):<.35,.01>
#Here is sample input for choice 2.#
Choice (1 or 2):<2>
ENTER S( 1):<.25>
ENTER S( 2):<.30>
ENTER S( 3):<.35>
Since the variance-covariance matrix is symmetric, only
the lower left half needs to be entered.
ie. var(S1)
cov(S2,S1) var(S2)
cov(S3,S1) cov(S3,S2) var(S3) ...
Enter row 1 of the variance-covariance matrix ( 1 values):
?<.0025>
Enter row 2 of the variance-covariance matrix ( 2 values):
?<0,.000625>
Enter row 3 of the variance-covariance matrix ( 3 values):
?<0,0,.0001>
#The program then prints the data and the results for
the overall test.#
Survival rates and variance-covariance matrix will be
saved in a file called CONTRAST.TMP (which can be used
as input to later runs of CONTRAST).
EXAMPLE DATA
Null Hypothesis: Homogeneous survival rates
Survival rates:
0.2500 0.3000 0.3500
============== Variance-covariance matrix ===========
0.002500
0.000000 0.000625
0.000000 0.000000 0.000100
CHI-SQUARE VALUE = 6.8000
DEGREES OF FREEDOM = 2
PROBABILITY = 0.0334
#The program then prompts for additional analyses.#
#In our example, we are comparing S(1) with S(2) and S(3).#
Would you like to
- compare survival rates with 2 or more groups
- enter a contrast vector to compare 2 groups of survival
rates
- start a new problem
- quit
#To compare means directly, enter a 1.#
Enter 1,2,3, or 4:<1>
To compare 2 or more groups of survival rates, you must
specify which group each survival rate belongs to. When
prompted for group number, enter 0 for survival rates not
in the contrast, 1 for survival rates in the first group,
2 for survival rates in the 2nd group, ...etc.
Enter a group number for each survival rate( 3 values)
?<1, 2, 3>
#The program then prints out the results for the 2 groups.#
Input group numbers:
1 2 2
Survival rates: #Means for the 2 groups.#
0.2500
0.3250
Difference between survival rates = 0.0750
============== Variance-covariance matrix ===========
0.002500
0.000000 0.000181
CHI-SQUARE VALUE = 2.0979
DEGREES OF FREEDOM = 1
PROBABILITY = 0.1475
#The program then prompts for the next comparison.#
Would you like to
- compare survival rates with 2 or more groups
- enter a contrast vector to compare 2 groups of survival
rates
- start a new problem
- quit
Enter 1,2,3, or 4:<2>
#The same comparison can be accomplished using a contrast.#
To contrast survival rates, you must specify which survival
rates are to be compared. To compare S(i) with S(j), enter
-1 in the ith position of the contrast vector and 1 in the
jth position of the contrast vector. For example to compare
S(2) with S(3), enter 0,-1,1 as the contrast vector. Make
sure you enter 0 in the positions which are not included
in the contrast.
Enter contrast vector (or Q to quit):<2,-1,-1>
Input contrast vector:
2.000 -1.000 -1.000
Scaled contrast vector:
2.000 -1.000 -1.000
Survival rates:
0.2500
0.3250
Difference between survival rates = 0.0750
CHI-SQUARE VALUE = 2.0979
DEGREES OF FREEDOM = 1
PROBABILITY = 0.1475
#The program then prompts for additional analyses.#
Would you like to
- compare survival rates with 2 or more groups
- enter a contrast vector to compare 2 groups of survival
rates
- start a new problem
- quit
Enter 1,2,3, or 4:<4>
#Exit the program by entering a 4. The program can be
restarted by#
#entering a 3.#
Examples
These examples are from Sauer and Williams (1989), and
illustrate both an example involving independent survival
rates and a complex example that has both variances and
covariances among survival rates. See Sauer and Williams
(1989) for more information about the examples.
Example 1. Survival rates of mallards (From Anderson 1975,
cited in Sauer and Williams [1989]).
Input data file:
| DATA FROM ANDERSON (1975) |
#Header.# |
| 6 |
#Number of survival rates.# |
| 1 |
#Input format type.# |
| .766,.076 |
#Survival rate 1, SE.# |
| .675,.025 |
#Survival rate 2, SE.# |
| .676,.010 |
#Survival rate 3, SE.# |
| .758,.099 |
#Survival rate 4, SE.# |
| .632,.016 |
#Survival rate 5, SE.# |
| .577,.026 |
#Survival rate 6, SE.# |
| 2 |
#Enter a contrast vector# |
| -1 1 0 0 0 0 |
#Contrast 1 # |
| 2 |
#Enter a contrast vector# |
| -0.6, -0.6, 0.4, 0.4, 0.4, 0 |
#Contrast 2 # |
| 2 |
#Enter a contrast vector# |
| -0.167, -0.167, -0.167, -0.167, -0.167, 0.833 |
#Contrast 3 # |
Program Output:
DATA FROM ANDERSON (1975)
Null Hypothesis: Homogeneous survival rates
Survival rates:
0.7660, 0.6750, 0.6760, 0.7580, 0.6320, 0.5770
============== Variance-covariance matrix ===========
0.005776
0.000000, 0.000625
0.000000, 0.000000, 0.000100
0.000000, 0.000000, 0.000000, 0.009801
0.000000, 0.000000, 0.000000, 0.000000, 0.000256
0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000676
CHI-SQUARE VALUE = 19.0758
DEGREES OF FREEDOM = 5
PROBABILITY = 0.0019
#In Sauer and Williams (1989), 3 orthogonal contrasts were
tested.#
#Contrast 1.#
Input contrast vector:
-1.000, 1.000, 0.000, 0.000, 0.000, 0.000
Scaled contrast vector:
-1.000, 1.000, 0.000, 0.000, 0.000, 0.000
Survival rates:
0.6750, 0.7660
Difference between survival rates = 0.0910
CHI-SQUARE VALUE = 1.2937 DEGREES OF FREEDOM
= 1 PROBABILITY = 0.2554
#Contrast 2.#
Input contrast vector:
-0.600, -0.600, 0.400, 0.400, 0.400, 0.000
Scaled contrast vector:
-3.000, -3.000, 2.000, 2.000, 2.000, 0.000
Survival rates:
0.6887, 0.7205
Difference between survival rates = 0.0318
CHI-SQUARE VALUE = 0.3714
DEGREES OF FREEDOM = 1
PROBABILITY = 0.5423
#Contrast 3.#
Input contrast vector:
-0.167, -0.167, -0.167, -0.167, -0.167, 0.833
Scaled contrast vector:
-1.000, -1.000, -1.000, -1.000, -1.000, 5.000
Survival rates:
0.5770, 0.7014
Difference between survival rates = 0.1244
CHI-SQUARE VALUE = 11.5633
DEGREES OF FREEDOM = 1
PROBABILITY = 0.0007
Example 2. Mourning dove data from the Eastern Management
Unit (Sauer and Williams 1989).
Input data file:
| MOURNING DOVE DATA FROM THE EASTERN MANAGEMENT UNIT |
#Header.# |
| 8 |
#Number of survival rates.# |
| 2 |
#Data entry type.# |
| .3135 |
#Survival rate 1.# |
| .3619 |
#Survival rate 2.# |
| .4677 |
#Survival rate 3.# |
| .3964 |
#Survival rate 4.# |
| .3627 |
#Survival rate 5.# |
| .2589 |
#Survival rate 6.# |
| .1774 |
#Survival rate 7.# |
| .1007 |
#Survival rate 8.# |
| .00714 |
#Row 1 of lower triangle of Variance-Covariance matrix.# |
| -.00168,.00376 |
#Row 2 of ".# |
| 0, -.00103,.00523 |
#Row 3 of ".# |
| 0, 0,-.00237,.00434 |
#Row 4 of ".# |
| .00168,-.00194, 0, 0, .00425 |
#Row 5 of ".# |
| 0, .00056,-.00073,0,0,.00190 |
#Row 6 of ".# |
| 0, 0, .00106,-.00090, 0, 0, .00067 |
#Row 7 of ".# |
| 0, 0, 0, .00036, 0, 0, 0, .00031 |
#Row 8 of ".# |
| 2 |
#Enter a contrast vector.# |
| 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0 |
#Contrast 1.# |
| 2 |
#Enter a contrast vector.# |
| -1.0, -1.0, 1.0, 1.0, 0, 0, 0, 0 |
#Contrast 2.# |
| 2 |
#Enter a contrast vector.# |
| 0, 0, 0, 0, -1.0, -1.0,1.0, 1.0 |
#Contrast 3.# |
Program output:
MOURNING DOVE DATA FROM THE EASTERN MANAGEMENT UNIT
Null Hypothesis: Homogeneous survival rates
Survival rates:
0.3135, 0.3619, 0.4677, 0.3964, 0.3627, 0.2589, 0.1774,
0.1007
============== Variance-covariance matrix ===========
0.007140
-0.001680, 0.003760
0.000000,-0.001030, 0.005230
0.000000, 0.000000,-0.002370, 0.004340
0.001680,-0.001940, 0.000000, 0.000000, 0.004250
0.000000, 0.000560,-0.000730,0.000000, 0.000000, 0.001900
0.000000, 0.000000, 0.001060,-0.000900, 0.000000, 0.000000,
0.000670
0.000000, 0.000000, 0.000000, 0.000360, 0.000000, 0.000000,
0.000000, 0.000310
CHI-SQUARE VALUE = 180.7535
DEGREES OF FREEDOM = 7
PROBABILITY = 0.0000
#In this example, we test 3 non-orthogonal contrasts.#
#Note that the program does not adjust the probability levels
for the#
#multiple comparison. #
#Contrast 1.#
Input contrast vector:
1.000, 1.000, 1.000, 1.000, -1.000,-1.000, -1.000, -1.000
Scaled contrast vector:
4.000, 4.000, 4.000, 4.000, -4.000, -4.000, -4.000, -4.000
Survival rates:
0.3849, 0.2249
Difference between survival rates = 0.1599
CHI-SQUARE VALUE = 23.7163
DEGREES OF FREEDOM = 1
PROBABILITY = 0.0000
#Contrast 2.#
Input contrast vector:
-1.000, -1.000, 1.000, 1.000, 0.000, 0.000, 0.000, 0.000
Scaled contrast vector:
-2.000, -2.000, 2.000, 2.000, 0.000, 0.000, 0.000, 0.000
Survival rates:
0.4320, 0.3377
Difference between survival rates = 0.0943
CHI-SQUARE VALUE = 2.4676
DEGREES OF FREEDOM = 1
PROBABILITY = 0.1162
#Contrast 3.#
Input contrast vector:
0.000, 0.000, 0.000, 0.000, -1.000, -1.000, 1.000, 1.000
Scaled contrast vector:
0.000, 0.000, 0.000, 0.000, -2.000, -2.000, 2.000, 2.000
Survival rates:
0.139, 0.3108
Difference between survival rates = 0.1718
CHI-SQUARE VALUE = 16.5487 DEGREES OF FREEDOM
= 1 PROBABILITY = 0.0000
Acknowledgments
We thank J. B. Hestbeck, W. Link, J. D. Nichols, G. W.
Pendleton, and B. K. Williams for commenting on the manuscript.
Literature Cited
Anderson, D. R. 1975. Population ecology of the Mallard.
V. Temporal and geographic estimates of survival, recovery,
and harvest rates. U. S. Fish Wildl. Serv. Res. Publ. 125.
110pp.
Brownie, C., D. R. Anderson, K. P. Burnham, and D. S.
Robson. 1985. Statistical inference from band recovery data-A
Handbook. Second ed. U.S. Fish Wildl. Serv. Resour. Publ.
156. 305pp.
Conroy, M. J., and B. K. Williams. 1984. A general methodology
for maximum likelihood inference from band recovery data.
Biometrics 40:739-748.
Hines, J. E., and J. R. Sauer. 1989. Program CONTRAST
- a general program for the analysis of several survival
or recovery rate estimates. Fish and Wildlife Technical
Report 24:1-7.
Neter, J., and W. Wasserman. 1974. Applied linear statistical
models. Richard D. Irwin, Homewood, Ill. 842pp.
Sauer, J. R., and B. K. Williams. 1989. Generalized procedures
for testing hypotheses about survival or recovery rates.
J. Wildl. Manage. 53:137-142.
Snedecor, G. W., and W. G. Cochran. 1980. Statistical
methods, Seventh edition. Iowa State Univ. Press, Ames.
507pp.
White, G. C. 1983. Numerical estimation of survival rates
from band-recovery and biotelemetric data. J. Wildl. Manage.
47:716-728.
SOFTWARE INVENTORY FORM
A. TITLE.
- CONTRAST: A program for the analysis of several survival
or recovery rate estimates.
B. FUNCTION.
- Sauer and Williams (J. Wildl. Manage 53:137-142, 1989)
recently described a general procedure for the comparison
of several rate estimates that incorporates associated
variance and covariance estimates. We describe a computer
program to implement this method. We also provide some
guidelines for its use in multiple comparisons of rate
data, and illustrate the use of the program with several
examples. We believe that the program will be used primarily
for the analysis of survival rates. However, the method
can be used for tests about any rates (or other parameters)
for which estimates and their associated variances and
covariances are available.
C. AUTHOR AND CONTACT PERSON.
- AUTHOR NAMES: James E. Hines and John R. Sauer.
- CONTACT PERSON:
James E. Hines
Patuxent Wildlife Research Center
U. S. Fish and Wildlife Service
Laurel, MD, USA. 20708
Telephone:301-497-5661
D. USERS.
| X Management |
X Other (Instructional) |
| X Research |
| X Extension |
E. SOFTWARE STATUS.
| Became operational |
1 April 1989 |
| Was last revised |
15 August 1989 |
| Revision is anticipated |
N/A |
F. SOFTWARE SOURCE.
X Original
G. TECHNICAL KNOWLEDGE NEEDED TO INTERPRET RESULTS.
Knowledge of basic statistics is necessary.
H. HARDWARE AND SOFTWARE REQUIREMENTS.
- Machine classification: 1. Micro (note: program written
on micro. May require modification for use on mainframes
and minis.)
- < 256K needed.
- Operating system is DOS.
- FORTRAN 77, Ryan-Macfarland.
- None.
I. OTHER TECHNICAL NOTES.
- Solution technique: See Sauer and Williams (1989, cited
above).
- Other notes: See user documentation.
|