extracting capture histories

announcements (new versions, changes, bugs, installation problems...) related to program MARK

extracting capture histories

Postby nlsanto2 » Fri Oct 25, 2013 9:41 am

Hello everybody,

I am working on some simulations with program MARK (POPAN package). I was wondering if there is a quicker way for extracting the encounter histories from the simulation data instead of copying them one by one. If I open the DBF file with excel I find all the parameter estimates, but not the encounter histories.

Any suggestion?

Thank you in advance :)

Nina
nlsanto2
 
Posts: 18
Joined: Wed Mar 14, 2012 5:01 am

Re: extracting capture histories

Postby cooch » Sat Dec 21, 2013 11:02 am

nlsanto2 wrote:Hello everybody,

I am working on some simulations with program MARK (POPAN package). I was wondering if there is a quicker way for extracting the encounter histories from the simulation data instead of copying them one by one. If I open the DBF file with excel I find all the parameter estimates, but not the encounter histories.

Any suggestion?

Thank you in advance :)

Nina


Depends on how comfortable you are at programming. First, you probably don't want the .DBF file -- look at the .fpt that gets generated during the simulations. In the .fpt file, each of the encounter histories are printed, for each simulation. The programming task, then, is to parse through the file and pull out the histories. This is made somewhat easier by the fact that the start of the histories is always a statement about the time interval:

Code: Select all
INPUT ---    time interval  1 1 1 1 1;
  INPUT ---           110000 16;
  INPUT ---           100000 40;
  INPUT ---           101110 3;
  INPUT ---           101000 7;
  INPUT ---           110101 1;


while at the end of the histories, there is always a blank line, followed by a statement about the number of unique histories read.

Code: Select all
  INPUT ---           000110 23;
  INPUT ---           000111 17;
  INPUT ---           000010 58;
  INPUT ---           000011 42;

      Number of unique encounter histories read was 54.


So, you write a script (say, in R, or perl, or python, or SAS...) to chug through the file, keep only lines between the start and end of these two things.

There are probably other ways to get there from here, but that works for me, on the very few occasions when I want to pool CH over simulations.
cooch
 
Posts: 1652
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University


Return to software problems/news

Who is online

Users browsing this forum: No registered users and 1 guest

cron