Adding a covariate to a Brownie recovery model

questions concerning analysis/theory using program MARK

Adding a covariate to a Brownie recovery model

Postby pat_14 » Thu Jun 17, 2021 8:02 pm

Hello,
I’m looking for some advice on adding a covariate to a dead recovery model.
My data set contains ~9,000 marked finfish, of which about 11% were harvested by recreational anglers (dead recoveries) over a 26 year study.

I’ve ran a Brownie dead recovery model using program MARK (not RMark) and have reasonable output. My .INP data is in the “classic recovery matrix” form. I have n=26 annual time intervals in the matrix.
I’d like to add a covariate that represents annual fishing pressure to the model. I realize that the disadvantage of the grouped recovery matrix is the inability to use individual covariates, but what about a covariate that is at the time step level, such as annual landings? Is there a way to add a time series (n=26) of annual landings data as a covariate in program MARK to my model?

I’m new to the program and may be missing something obvious, but any suggestions would be much appreciated.

Thanks in advance!
pat_14
 
Posts: 6
Joined: Wed Jun 16, 2021 2:45 pm

Re: Adding a covariate to a Brownie recovery model

Postby cooch » Thu Jun 17, 2021 8:16 pm

Sure -- using a design matrix. Chapter 6 (the 'linear models' chapter in the MARK book) - section 6.8. If you are using Brownie models, make sure you remember that the number of recovery and survival parameters differ.
cooch
 
Posts: 1628
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: Adding a covariate to a Brownie recovery model

Postby pat_14 » Thu Jun 17, 2021 9:48 pm

Thank you!
pat_14
 
Posts: 6
Joined: Wed Jun 16, 2021 2:45 pm

Re: Adding a covariate to a Brownie recovery model

Postby cooch » Fri Jun 18, 2021 9:41 am

Given that you didn't know that already, I'll guess you haven't gone through Chapter 6 in any detail. Before you plunge into the deep end of the pool, you should.
cooch
 
Posts: 1628
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: Adding a covariate to a Brownie recovery model

Postby pat_14 » Mon Jul 05, 2021 11:28 pm

Thank you for the advice. I've gone back and read chapters 1-8 of the gentle introduction, and am into chapter 9.

Before re-visiting any covariate additions, I looked at GOF for the general S(t)f(t) model I previously ran. My calculated c-hat values using bootstrap and ESTIMATE methods have been well above 3. I'm assuming this over dispersion could be from my sparse dataset and/or structural problems.

Are there any striking aspects of my data that would point towards poor model fit that a beginner like myself would overlook?

My recapture summary array is as follows (apologies for the alignment issues from my copy+pasting) :

/* tag recapture 2, 1 group, 1996-2020
glabel(1)=ALL */
recovery matrix group=1;
07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00;
11 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00;
10 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 02 00;
02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00;
01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 01 00 00;
00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00;
09 01 00 01 00 02 02 00 00 00 00 00 00 00 00 02 04 02 00;
13 04 01 00 00 00 00 00 00 00 01 00 00 04 00 01 00 00;
27 13 00 00 00 00 00 00 00 00 00 02 05 00 01 03 00;
23 08 02 00 00 00 00 00 01 01 00 02 01 00 00 00;
24 09 00 00 00 00 00 00 00 00 01 00 01 01 00;
12 00 00 00 00 00 00 00 00 01 00 00 00 00;
18 01 00 00 00 00 00 00 00 00 00 00 00;
25 00 01 00 00 00 00 00 00 00 00 00;
02 02 00 00 00 00 00 00 00 00 00;
11 01 00 00 00 00 00 00 00 00;
26 01 00 00 00 00 00 00 00;
29 03 01 00 00 00 00 00;
08 02 00 00 00 00 00;
40 05 01 00 00 00;
120 04 03 00 00;
48 10 01 00;
90 18 04;
192 49;
172;
39 50 44 03 19 32 187 137 356 373 363 135 148 290 90 123 274 319 214 637 791 511 985 2226 1367;


Any suggestions would be greatly appreciated!
pat_14
 
Posts: 6
Joined: Wed Jun 16, 2021 2:45 pm

Re: Adding a covariate to a Brownie recovery model

Postby gwhite » Tue Jul 06, 2021 8:53 am

Two things jump out from a quick glance at your data. First, you have a zero value on the diagonal -- which leads to lack of identity for some of the S(t) and f(t) parameters -- review Brownie et al.
Second, there are a few animals that are not recovered for 5 or more years after release, but with most recoveries occurring immediately after release. These animals are causing a lot of individual heterogeneity that you are detecting with c-hat.

A trick to get the recovery matrix produced as an encounter history matrix is to dump the residuals to an Excel file -- and you'll see your encounter histories, albeit pooled across observations. If you really have an individual covariate, you'll have to replicate each history appropriately.

Gary
gwhite
 
Posts: 329
Joined: Fri May 16, 2003 9:05 am

Re: Adding a covariate to a Brownie recovery model

Postby pat_14 » Tue Jul 06, 2021 10:26 am

Thank you for your help!
pat_14
 
Posts: 6
Joined: Wed Jun 16, 2021 2:45 pm

Re: Adding a covariate to a Brownie recovery model

Postby cooch » Tue Jul 06, 2021 10:30 am

Quick followup to Gary's post -- on converting from the triangular 'recovery matrix' (which aggregates the data over individuals) to a 'standard' encounter-history file, with the added twist of going from aggregate -> individual records (i.e., one line, and on EH, per individual). This is necessary if you want to use an individual covariate.

As Gary pointed out, first step is to export the residuals to an Excel file: 'Output | Specific Model | Output residuals'. In this Excel file, there will be columns for the 'History', 'Observed', and 'Expected'. Its the first two you want. Now, while it is possible to do the next steps in Excel, here is one (out of like many alternatives) approach using R (since more folks use R these days for various things).

1\ copy the 'History' and 'Observed' columns from the Excel spreadsheet to an ASCII file, with at least a space between the history, and the aggregated history. I'll call this file aggregated.inp.

2\ fire up R, and run the following script (modifying file paths and anything else as needed):

Code: Select all
# step 1)  get aggregated encounter data
   aggregated <- read.table("C:/users/egc/Desktop/aggregate.inp", header=F);
   colnames(aggregated) <- c("history","observed");

# step 2) initialize the file you will output individual histories to...
  file.create("c:/users/egc/Desktop/individual.inp", showWarnings = FALSE)

# step 3) the main routine -- replicate each history freq times
   for (i in 1:nrow(aggregated)) {

    indiv <- replicate(aggregated$observed[i],aggregated$history[i]);
     indiv <- as.data.frame(indiv);
     
     # add the following at end of each history
      indiv$count <- " 1;";

 write.table(indiv, file="c:/users/egc/Desktop/individual.inp", sep=" ", append=TRUE , quote= FALSE, row.names=FALSE, col.names=FALSE)

 }


The file 'individual.inp' should contain the reformatted individual encounter histories. You can modify this new file to include individual covariates -- simply strip off the semipcolon after the '1;' at the end of each line, and append the appropriate covariate value to the right of the 1 (separated by a space from the 1). The formatting for individual covariates is covered in chapter 2 and chapter 11.
cooch
 
Posts: 1628
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University


Return to analysis help

Who is online

Users browsing this forum: No registered users and 12 guests

cron