Page 1 of 1

Indicating removals in RMark input files?

PostPosted: Thu Aug 22, 2013 5:50 pm
by Snail_recapture
Hi all,

I have just started learning RMark in the last few days, so apologies for the very basic question! But just want to be sure I've understood correctly.

In my experimental design, I had a number of encounter occasions when I recorded survival but did not remove the animals from the population. At the end of the experimental period, there was about 10 days where the animals were then removed from the population when encountered. From reading the MARK manual, I have gathered that this can be accounted for by a -1 in the frequency column, and this represents being removed at the last encounter occasion - so this results in there being two rows for each individual? As an example, this is what my data looks like:

/* ID, ch, freq, treatment, PC1 */

/*RR1*/ 00000000100001000100000 1 0 -0.02694881;
/*RR1*/ 00000000100001000100000 -1 0 -0.02694881;
/*RR10*/ 00000000010110001000000 1 0 -0.038345779;
/*RR10*/ 00000000010110001000000 -1 0 -0.038345779;
/*RR21*/ 00000000010110001000000 1 0 0.009616546;
/*RR21*/ 00000000010110001000000 -1 0 0.009616546;
/*RR24*/ 00000000010000001000000 1 1 -0.003647904;
/*RR24*/ 00000000010000001000000 -1 1 -0.003647904;
/*RR28*/ 00000000010110001000000 1 1 -0.029564797;
/*RR28*/ 00000000010110001000000 -1 1 -0.029564797;

Again, apologies for the basic question, I just want to be sure the data structure is right before getting too deep into model building! Thanks in advance :)

Re: Indicating removals in RMark input files?

PostPosted: Thu Aug 22, 2013 6:19 pm
by jlaake
The structure in RMark and MARK for capture histories and frequencies are identical. The only difference is that with RMark a single record is used for each group rather than having multiple frequency values on a single record. For example,

10011 1 2;
00101 0 1;

for Males and Females in RMark becomes

10011 1 Male
10011 2 Female
00101 1 Female

RMark then restructures the inp file to match the MARK structure with 2 frequencies per group.

For a loss on capture, you use -1 in the freq field to indicate that it was removed after the last occasion. You only use a single record.

--jeff

Re: Indicating removals in RMark input files?

PostPosted: Thu Aug 22, 2013 7:17 pm
by Snail_recapture
That's great, many thanks for the speedy response! :D

Re: Indicating removals in RMark input files?

PostPosted: Thu Aug 22, 2013 7:47 pm
by Snail_recapture
But of course, I have hit upon a new obstacle...

I'm trying to generate my process.data function. My code and error is as follows:

Code: Select all
> tbh.fem<-convert.inp("C:/Users...~femRMark.inp",covariates=c("treatment","PC1"))

>tbh.process=process.data(tbh.fem,model="CJS",time.intervals=c(1,1,1,1,1,9,1,1,1,1,9,1,2,1,11,1,3,3,1,27,16,8),groups="treatment")


I've tried converting to a factor but it doesn't seem to be interested (using as.factor - perhaps too simplistic?).
I've also tried importing my datafile with text instead, "within" and "between" instead of "0" and "1", but then R just coerced them to NAs. I tried defining field.types, but I got the error
Code: Select all
unused argument(s) (field.types = c("n", "f", "n"))

So i'm a bit confused. Sorry, I know this is probably something super simple, but I have read C.12 Data structure and import for RMark, and the examples there are either factorial or numeric, but not both. Unless i've missed something really obvious, in which case my apologies.. :oops:

Re: Indicating removals in RMark input files?

PostPosted: Thu Aug 22, 2013 9:55 pm
by bacollier
I'm trying to generate my process.data function. My code and error is as follows:

Code: Select all
> tbh.fem<-convert.inp("C:/Users...~femRMark.inp",covariates=c("treatment","PC1"))

>tbh.process=process.data(tbh.fem,model="CJS",
time.intervals=c(1,1,1,1,1,9,1,1,1,1,9,1,2,1,11,1,3,3,1,27,16,8),groups="treatment")


I think if you do (labels being whatever/however many you need them to be, I used 1 and 2), then I think it should work (assuming I did not misspell anything and that use.comments=is not needed).

Code: Select all
tbh.fem$treatment=factor(tbh.fem$treatment,labels=c("1","2")) 
tbh.proc=process.data(tbh.fem, model="CJS", time.intervals=c(1,1,1,1,1,9,1,1,1,1,9,1,2,1,11,1,3,3,1,27,16,8), groups="treatment")


\bret

Re: Indicating removals in RMark input files?

PostPosted: Fri Aug 23, 2013 10:15 am
by Snail_recapture
Perfect - thank you! :D