Formatting input file?

questions concerning analysis/theory using program MARK

Formatting input file?

Postby Boxor » Tue Aug 31, 2010 12:00 pm

I'm relatively new to MARK and have never performed an analysis on a large data set before so that brings me to my current question. Is there a way to automate the coding of the encounter histories. It would be very tedious to go through all 2000+ tagged individuals for the 20+ years of the study and code it all by hand. Does anyone know of a way to automate this process using excel, R or a similar program?

I appreciate any guidance on this issue, thanks-
Boxor
 
Posts: 8
Joined: Wed Aug 25, 2010 3:10 pm

Re: Formatting input file?

Postby jlaake » Tue Aug 31, 2010 12:08 pm

If your data are in Excel, you can use a pivot table on animal by occasion(date/survey). In Access, you can use crosstab query to do the same thing. In R you can use the table function.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Formatting input file?

Postby Boxor » Tue Aug 31, 2010 12:49 pm

I appreciate the quick reply and this is exactly the type of process I'm looking for, I think. Is there anyone who can elaborate on the methods mentioned above? Maybe point me in the direction of a tutorial, etc?
Boxor
 
Posts: 8
Joined: Wed Aug 25, 2010 3:10 pm

Re: Formatting input file?

Postby jlaake » Tue Aug 31, 2010 1:17 pm

You are not providing enough detail to answer your question. How are your data stored? How are they structured? The reason there is no single program to do this is because everyone handles their data differently. If there was a single structure, then it could be automated.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Formatting input file?

Postby Boxor » Tue Aug 31, 2010 2:10 pm

The data is currently stored in several excel spreadsheets which are being "cleaned up" and will be available to me in both excel and access. The time series spans over 20 years and there are several thousand individuals that have been marked during this time. Each entry has a unique tag code and date of mark/recapture associated with it. Each sampling trip some marked individuals are encountered and those that are not marked when caught are marked during that first capture. So, I have many sampling periods within each year when individuals were either marked for the first time, encountered again or not encountered again. I need to generate an input file based on data that is stored in this manner. I'm sure there are several ways to deal with this; I'm just hoping one of them will apply to my problem. I need to account for each marked individual, whether it is seen or not, during each sampling event and also add records for all newly marked individuals during that sampling trip.

I hope this provides a little more detail. If suggestions can be made on the best way to format the data in excel or access to expedite this coding that would be appreciated as well.

I apologize for the lack of information but as I said I'm relatively new to MARK and all previous analyses I've done have been simple and straightforward.
Boxor
 
Posts: 8
Joined: Wed Aug 25, 2010 3:10 pm

Re: Formatting input file?

Postby jlaake » Tue Aug 31, 2010 2:14 pm

I'll send you an example of a pivot table off list.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Formatting input file?

Postby Boxor » Tue Aug 31, 2010 2:41 pm

jlaake wrote:I'll send you an example of a pivot table off list.

--jeff



I appreciate all of your help. Seeing an actual data file makes this a lot easier to comprehend.
Boxor
 
Posts: 8
Joined: Wed Aug 25, 2010 3:10 pm

Re: Formatting input file?

Postby mcmelnychuk » Tue Aug 31, 2010 3:38 pm

After you get your pivot table set up (e.g. individual animals as rows and sampling occasions as columns), you could do this:
1) make a similar table (same row and column headings) and fill it with 0's and 1's using if statements (copied across columns and down rows) to represent no capture or capture for each cell
2) make an additional column for the encounter histories. If your data are in columns B to L, for example, use the formula:
=B&C&D&...&L
This will concatenate all the 1's and 0's together.
3) copy and paste as values in the first column of a new file. Add on individual covariates in other columns if you're using them, and then paste a ";" at the end of each row.

Good luck, Mike
mcmelnychuk
 
Posts: 24
Joined: Thu Apr 17, 2008 4:11 pm
Location: University of British Columbia


Return to analysis help

Who is online

Users browsing this forum: No registered users and 1 guest