Issues with RMARK import (multi-state models)

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

Issues with RMARK import (multi-state models)

Postby Andre23 » Mon Jan 20, 2025 10:18 am

I would like to run a goodness of fit test and estimate over-dispersion of my multi-state global model.
The aim is to adjust AICc values based on the c-hat and re-order the models correctly (taking into account the overdispersion). I understand (unless it has been updated) that I need to use the function "export.MARK" to be able to import my set of models to the MARK interface ('.Rinp' file)

My R code to export the models to MARK:
Code: Select all
# Create model list and run an assortment of models
MSmodel.list=create.model.list("Multistrata")
# Run set of models
mstrata.results=mark.wrapper(MSmodel.list,data=ms_proc,ddl=ms_ddl)
MS_results = mstrata.results$model.table
# export for MARK
export.MARK(ms_proc,project="MS_94-22",model=mstrata.results)


1. When I try to import the Rinp file in MARK, it creates a '.DBF' file but it tells me "no output is stored in this Results Database" (The DBF is just empty I can't see any list of models)
2. Is there a way to run a goodness-of-fit test for multi-state models directly in RMark, or is it only possible using the MARK interface?

Thank you for your help
Andre23
 
Posts: 16
Joined: Thu Jun 20, 2024 6:53 am

Re: Issues with RMARK import (multi-state models)

Postby cooch » Mon Jan 20, 2025 10:36 am

The canonical approach to MS godness-of-fit testing are the approaches encoded in U-CARE -- following Roger Pradel's publication describing the methods. Section 10.5 in chapter 10 (the MS chapter), and Remi Chouet's paper on the software (https://oliviergimenez.github.io/pubs/C ... 9UCARE.pdf). You can, in theory, run median c-hat in MARK, but I'm not convinced it is as robust as U-CARE.

1\ Good news is that U-CARE can handle MARK .inp files generally without a lot of massaging. With one exception -- U-CARE cannot handle character states. e.g., if you use B00NN0B0 where B might be 'breeder' and 'N' nonbreeding, you'll need to use some numeric coding instead. So, say 2 for B, and 1 for N: 20011020

2\ be advised that MS models are 'data hungry', such that if your data are 'sparse', then (i) fitting a GOF test to a fully-time dependent model is likely to fail (since it is based on multilevel contingency tables, which are notoriously 'twitchy' when it comes to sparse tables), and (ii) you might have to consider GOF for a less general model (i.e., not fully time-dependent), which may or may not work with U-CARE (I can't actually recall).

3\ U-CARE is Windows-only (if I recall correctly).

Good luck.
cooch
 
Posts: 1652
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: Issues with RMARK import (multi-state models)

Postby jlaake » Mon Jan 20, 2025 11:41 am

You need to specify a model rather than a model list. So use mstrata.results[[1]] in export.MARK
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Issues with RMARK import (multi-state models)

Postby Andre23 » Wed Jan 22, 2025 7:05 am

Thank you both for the replies

1. Regarding overdispersion testing:
I initially identified overdispersion in my time-dependent model using U-CARE, to account for this, I added age classes to survival, detection, and transition parameters.
However, I now need to quantify the remaining overdispersion after incorporating these age classes.
If I understand, U-CARE only allows testing of fully time-dependent models - is there another approach to test overdispersion in my age-class model?

2. Model export issue:

I tried to export a specific model using mstrata.results[[1]] in export.MARK:
Code: Select all
export.MARK(ms_proc,project="MS_94-22",model=mstrata.results[[1]], replace=TRUE)

The exported Rinp file gives an empty DBF when imported back into MARK (empty table)
Is it the correct export procedure for multistate models?

Thank you
Andre23
 
Posts: 16
Joined: Thu Jun 20, 2024 6:53 am

Re: Issues with RMARK import (multi-state models)

Postby jlaake » Wed Jan 22, 2025 12:22 pm

Not sure what is going wrong for you. Are you selecting the *.Rinp file to import into MARK? I just did the following and it worked fine. Try this and see if it fails for you.

Code: Select all
library(RMark)
data(mstrata)
dp=process.data(mstrata,model="Multistrata")
ddl=make.design.data(dp)
model=mark(dp,ddl)
export.MARK(dp,"test",model)
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Issues with RMARK import (multi-state models)

Postby Andre23 » Fri Jan 24, 2025 1:48 pm

Hi @jlaake

I just tried your example. I then imported the "test.Rinp" into MARK

Same output, the DBF is empty, no model appears in the browser
Andre23
 
Posts: 16
Joined: Thu Jun 20, 2024 6:53 am

Re: Issues with RMARK import (multi-state models)

Postby jlaake » Wed Jan 29, 2025 9:03 pm

As it turns out, the .tmp files for the models to be imported into MARK were not in the directory with the .Rinp file. He cleared out the directory except for essential files and then it worked. However, this doesn't seem to be a reasonable explanation as it is creating files that aren't there previously and export.MARK didn't register any errors. Regardless, everything is now working for him. I tried to break the code in various ways but didn't find anything that caused a problem.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest