CONVERTING DATA FROM FIELD RECORDS TO CAPTURE HISTORIES USING SAS

As we discussed in lecture and lab at various times, one needs to be able to convert data from ordinary records as usually taken in field studies, to the sort of capture history format recognized by MARK and other software. That is, typically we have data that look like:

Animal Id Date captured other information (age, sex, etc)
1 04 May 1999 adult male
1 02 Jul 2000 adult male
1 15 Jan 2001 adult male
2 04 May 1999 subadult female
.
.
999 07 Jul 2001 juvenile female


and we wish to convert in into records resembling

Capture histories individual
1 1 0 1 1 1 1
0 1 0 0 0 0 2
0 0 0 1 1 0 3
1 0 0 0 1 0 4
. . . . . . .
1 0 1 1 1 1 999

To illustrate this, take an example data set which is in the "standard" format of 1 record for each animal encountered on each occasion. The data in this example are already sorted by animal (ring number in this case) but in general you would need to sort before the conversion. The input data have >2000 lines of various combinations of individual encounters; many of these are repeated within year (capture occasions) and are thus for the purposes below redundant. Save this file to the C:\ directory.

A SAS program reads these data, labels each year as a capture occasion, and produces '1' for years in which the animal was captured and '0' when not captured. These in turn become columns in capture histories. The program provides 2 types of outputs: the first of records by individual animal, with 1 or 0 in the group column (male or female in this case). The second format summarizes these records into unique capture histories, where the numbers following the history are the frequencies of each group (males and females) having that history. Either format is directly readable into program MARK.


Send mail to Instructor Return to home page

Last updated 28 April 2008

Powered by Zope