multi-state model for spatial application

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

Re: multi-state model for spatial application

Postby jlaake » Fri Jan 11, 2013 3:35 pm

If you look at the code for import.chdata, your suggestion is what it does.

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

Re: multi-state model for spatial application

Postby megpetrie » Fri Jan 18, 2013 5:58 pm

Thanks Mike, Jeff and Tammy,
I'm still testing whether I want to use distance as a group covariate (ala Mike M) or use post-hoc methods to calculate instantaneous M.
I wanted to run my formula by you to make sure this is legit.
[codesh.ddl$Phi$s1=0
sh.ddl$Phi$s1[sh.ddl$Phi$time=="1"]=1
sh.ddl$Phi$s2=0
sh.ddl$Phi$s2[sh.ddl$Phi$time=="2"]=1
sh.ddl$Phi$s3=0
sh.ddl$Phi$s3[sh.ddl$Phi$time=="3"]=1
sh.ddl$Phi$s4=0
sh.ddl$Phi$s4[sh.ddl$Phi$time=="4"]=1
sh.ddl$Phi$t3diff=0
]Phi.pop.distance=list(formula=~1+s1:pop:distance1+s2:pop:distance2+s3:pop:distance3+s4:pop:distance4[/code]
Where distanceN = the distance of segment N for each population and pop is population

Hopefully this is correct.
I'm also interested in what you think about the question of whether to include distance if the AICc is larger for including it. The same model without distance has a much smaller AICc, but it almost seems inappropriate not to include it. I guess there could be cases where survival does not necessarily vary with distance.
Let me know what you think.

Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: multi-state model for spatial application

Postby mcmelnychuk » Sun Jan 20, 2013 6:57 pm

Hi Megan,

When I've used these models I used a slightly different formulation, below. The main difference is I just have a single distance covariate representing the length of each segment, and I achieve segment-specificity using only the time__:distance interactions, not separate distance covariates. Keep in mind I haven't done this in a multi-state model, so might be missing something in that regard.

-after using make.design.data(), I use merge.design.covariates(sh.ddl$Phi, df=survcovar, bygroup=T, bytime=T).

-survcovar is the result of read.csv("segment distances.csv"), where "segment distances.csv" is manually set up with columns: group, time, dist. The group names should be identical to those returned by make.design.data(), and time should match up with the appropriate segment.

-then I add dummy variables for the group:segment interactions. In my analyses I allowed for separate relationships of logit(Phi) vs. segment distance in river and ocean segments:

sh.ddl$Phi$river=0
sh.ddl$Phi$river[sh.ddl$Phi$time%in%1:3]=1

sh.ddl$Phi$ocean=0
sh.ddl$Phi$ocean[sh.ddl$Phi$time%in%4:6]=1

-Phi.pop.distance=list(formula=~ dist:river + dist:ocean + other covariates you want to include, remove.intercept=T)

So I use a single distance covariate, rather than separate covariates for each segment. I suspect both approaches can work.

In this example all groups shared the same migration route, but the way you coded it with time:pop dummy variables to represent particular segments for particular populations should work, as long as it allows for distance3 for pop A to differ from distance3 for pop B in your inputted covariate data (or wherever the particular segment was that physically differed for different populations).

One way to check that it's performing as intended is to run a model that has only distance as a survival covariate, nothing else like population, body length, etc. Then go through the estimated real Phi parameters and check that the Phi estimates for particular segments are the same for different populations when they should be (because the poupulations share the same physical segment of the migration and the same distance covariate value), and different for different populations in the segments where migration routes are not shared.

In terms of QAICc comparisons, your distance-based model likely has many fewer parameters than the segment-independent model. By constraining logit(Phi) to segment distance, you're saying that the slope is equal across all segments. There might be a happy medium between this and the segment-independent models. One model I've found that serves as a happy medium is to allow for indpendent Phi estimates for each release group in their first segment after release, and thereafter in remaining segments have logit(Phi) constrained to distance. The reason for this is that release groups may differ greatly in survival immediately after release due to different vulnerabilities to predation, especially if you're including wild and hatchery-reared populations in the same analysis (in which case you could also allow for separate survival-distance relationships between wild and hatchery groups, to allow for greater flexibility). After that initial mortality component, the relationship with distance segment may be more consistent for the remainder of the migration.

Hope this helps,
Mike
mcmelnychuk
 
Posts: 24
Joined: Thu Apr 17, 2008 4:11 pm
Location: University of British Columbia

Re: multi-state model for spatial application

Postby jlaake » Tue Jan 22, 2013 12:12 pm

Megan-

Not certain what you are doing with the formula and why you have separate distance covariates. You should have a single distance covariate that has different values for each time. Also, not sure why you are using dummy variables with distance. Also, using distance as a covariate is not the same as computing a survival per unit distance unless you use the log link rather than the logit link.

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

Previous

Return to RMark

Who is online

Users browsing this forum: No registered users and 3 guests