RMark - TSM model questions

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

RMark - TSM model questions

Postby tiffanygoh » Tue Sep 08, 2020 4:12 am

Hi,

Hope it is okay to tag onto this post. I have capture histories from 1988-2008 and 2012-2018. There was a gap in data collection (2009, 2010 and 2011). I am running CJS models including TSM.

I have a few doubts,

1) When I click to see the table after importing my dataset, the number of males and females are correct. However, the number of males and females are equal in the summary. Are my codes for grouping sex wrong?

2) TSM bins - I want to account for transients in my models. Initially my bins were set as (0,1,30). After running the models, my last survival estimate I derived was for 2017. Am I not supposed to get an estimate for 2018 as well?

3) TSM bins - Then I replace 30 to 28 as I have 28 occasions (1988-2018 with a 4 year gap). However, this led to 2 NA's in ageclass. I don't fully understand how RMark treats the 4 year gap.

These are the first lines of my code,
Code: Select all
#insert sex data, convert, and check first 5 lines
winter.sex=convert.inp("~/Desktop/RMark/MF dataset 1988-2018w2012/MF_D1D2D3_1988-2018.inp",
group.df = data.frame(sex=c("Female","Male")))

# Check first and last few records
head(winter.sex)
tail(winter.sex)

#process data - sex intervals are 1 except 21st when there was a 4 year gap (interval)
winter.sex.process=process.data(winter.sex,model="CJS",begin.time=1988,
time.intervals=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1), groups="sex")

#make design data
winter.sex.ddl=make.design.data(winter.sex.process)
summary(winter.sex.ddl$Phi)


# Add design data for age class (ageclass)
winter.sex.ddl=add.design.data(winter.sex.process,winter.sex.ddl,parameter="Phi",type="age",
bins=c(0,1,28),name="ageclass",right=FALSE,replace = TRUE)
winter.sex.ddl$Phi
summary(winter.sex.ddl$Phi)


Any help would be great :)
tiffanygoh
 
Posts: 8
Joined: Mon Aug 10, 2020 10:45 am

Re: RMark uneven primary and secondary time intervals

Postby jlaake » Tue Sep 08, 2020 3:35 pm

Have you read the workshop notes in the documentation zip that is given in the link when you type library(RMark)?

1) You didn't provide a sample of your data so it is not possible for me to work out if you have used convert.inp correctly. Also, have you been using MARK such that you already have a .inp file? If not then you should be using import.chdata instead and using the RMark format for data entry which is much more straightforward. Can't help anymore there without more information.

2) If your last occasion is 2018, you get a survival estimate up to 2018 but survival is an interval parameter and they are labelled based on the first time in the interval - survival from 2017 to 2018 is shown as 2017. This is made very clear in multiple places in the documentation and workshop notes.

3) Your data starts in 1988 so for the survival from 2017 to 2018, the TSM (age) value will be 2017-1988 =29. So when you used 0,1,28 as intervals it left off 29 for males and females = the 2 records with NA. For an animal released in 1988, the TSM in 2008 will be 20 and in 2012 it will be 24, in 2013 it will be 25 etc. Nothing magical. It just adds the time interval value for each record. For an animal first caught in 2008 it will be 0 and then in 2012 it will be 4. That is the one problem with using unequal time intervals. The alternative is to put dummy data in the capture history with 3 0's for 2009,2010, and 2011 and fixing p for those 3 occasions to be 0. You also have to be careful not to try an annual survival model because you can only estimate a constant survival from 2008 to 2012.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: RMark - TSM model questions

Postby tiffanygoh » Wed Sep 09, 2020 3:52 am

Hi Jeff,

Thanks for replying so quick and explaining the bit on TSM.

My inp file looks like this (first 5 lines for females and males, respectively)

0000000010000000000000000000 1 0;
0000000000000000000000001000 1 0;
0000000000000000000000010000 1 0;
0000000000000000000000000100 1 0;
0000000000000000000000100000 1 0;

0001000000000000000000000000 0 1;
0000000000000010000000000000 0 1;
0000000000000000000000010000 0 1;
0000100000000000000000000000 0 1;
0001000000000000000000000000 0 1;
tiffanygoh
 
Posts: 8
Joined: Mon Aug 10, 2020 10:45 am

Re: RMark - TSM model questions

Postby jlaake » Wed Sep 09, 2020 8:17 am

So that looks fine. I guess I don't understand what the problem is when you say that they are equal in the summary. Are you talking about the data or the design data? When you ask for help in their forums you have to demonstrate the problem or concern.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: RMark - TSM model questions

Postby tiffanygoh » Wed Sep 09, 2020 10:44 am

Yes I am talking about the design data. After calling this line of code,

Code: Select all
summary(winter.sex.ddl$Phi)


I get the summary of the design data and among them, group and sex showed equal numbers for males and females. I can't upload a screenshot of the summary but shown below are the last two columns, which as you see in sex it shows equal numbers.

Time
Min. : 0.0
1st Qu.:13.0
Median :18.0
Mean :18.5
3rd Qu.:26.0
Max. :29.0

Sex
Female:378
Male:378

My question is why would the design data summary show equal numbers of males and females?
tiffanygoh
 
Posts: 8
Joined: Mon Aug 10, 2020 10:45 am

Re: RMark - TSM model questions

Postby jlaake » Wed Sep 09, 2020 11:08 am

Because the design data describe the structure of the model. It describes the cohorts, occasions/times, ages and groups. It is essentially data linked to the pims. If you had 10 times as many capture histories you would have the same number of design data records. That number of records depends on the number of occasions and groups.

Please read the workshop notes thoroughly and when you post give results that demonstrate the problem like you have done here and you will save us both time.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: RMark - TSM model questions

Postby tiffanygoh » Wed Sep 09, 2020 11:51 pm

Thanks for the explanation Jeff.
tiffanygoh
 
Posts: 8
Joined: Mon Aug 10, 2020 10:45 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest