Page 1 of 1

ANODEV function in RMark.

PostPosted: Mon Oct 09, 2023 8:48 am
by nesmonde
Hi fellow RMark users,

Is there a ANODEV function in RMark? I'm able to calculate the R-squared but I would like to get the F-statistics and P-values too.

Thanks for all the help.

Re: ANODEV function in RMark.

PostPosted: Mon Oct 09, 2023 9:46 am
by jlaake
No.

Re: ANODEV function in RMark.

PostPosted: Mon Oct 09, 2023 9:49 am
by nesmonde
jlaake wrote:No.


How come?

Re: ANODEV function in RMark.

PostPosted: Mon Oct 09, 2023 9:58 am
by cooch
nesmonde wrote:
jlaake wrote:No.


How come?


Because like a fair number of MARK features, ANODEV is coded into the GUI. RMark does not try to implement all of the GUI features. Rather, it is a robust a sophisticated front-end to using the numerical estimation capabilities that MARK has.

Think of it this way. MARK has a number of high-level numerical estimation routines written in FORTRAN. Both the 'classic' MARK GUI, and RMark provide ways to 'communicate' model structures and such to these routines. In the case of the 'classic' GUI, Gary has also added a number of other features (e.g., simulation tools). RMark doesn't have those (but has its own extensions - based on the ability to then work within R to post-process information returned to it from the numerical routines).

And, specific to ANODEV, I can count on one hand the number of people that have used it. If you really want to use ANODEV, and P-values and all that, then you can do it all by hand (or, code it up yourself in R) -- Brett Sandercock made a nice post several years ago about ANODEV mechanics: viewtopic.php?f=1&t=3736&hilit=ANODEV

Re: ANODEV function in RMark.

PostPosted: Mon Oct 09, 2023 10:19 am
by cooch
cooch wrote:. In the case of the 'classic' GUI, Gary has also added a number of other features (e.g., simulation tools)...


The 'other features' are 'baked in' to the GUI, and are only accessible if you use GUI-based MARK.

Re: ANODEV function in RMark.

PostPosted: Mon Oct 09, 2023 10:46 am
by jlaake
Thanks Evan. You can also use export.MARK and then use features in MARK gui if you have Windows.

I have no interest in hypothesis testing and never found a use for ANODEV. I know you didn't mean any disrespect but always good to remember why people write free software. I wrote RMark to make my analysis of long term data sets easier when I got frustrated with the MARK GUI. I decided to share it so others could benefit from it as well and I have added numerous models that I have no interest in or will ever use. I retired 6 years ago but continue to support RMark and will do so as long as I am able. But as Evan noted I'm unable to access the MARK GUI and would have to program a number of features that are in it and not in the FORTRAN code mark.exe. Recognizing that limitation I wrote export.MARK. If others are willing to write code to implement some of these features, I'd be glad to work with them to incorporate it into RMark.

Re: ANODEV function in RMark.

PostPosted: Wed Oct 11, 2023 1:10 pm
by nesmonde
Apologies if my question came across as disrespectful, that was not my intention nor do I want to start a debate. I don't know anyone else in my department that uses this software so my understanding of MARK, RMark and the differences between them is limited so I am reliant on this forum, the manual and google to help me so I had to ask why.

Thank you both for providing an explanation and alternative options. If anyone is interested in this further Gimenez and Barbraud (2017) did create a ANODEV function and F statistic and p-value calculation:
Code: Select all
# get info on model with time-dependent survival
devtime = phitpt$results$lnl
npartime = phitpt$results$npar
# get info on model with constant survival
devct = phipt$results$lnl
nparct = phipt$results$npar
# test each covariate:
stat = rep(NA,12)
df1 = rep(NA,12)
df2 = rep(NA,12)
for (i in 1:12){
   name = paste('phix',i,sep="")
   devco = get(name)$results$lnl
   nparco = get(name)$results$npar
   num = (devct - devco)/(nparco-nparct)
   den = (devco - devtime)/(npartime-nparco)   
   stat[i] <- num/den
   df1[i] <- nparco-nparct
   df2[i] <- npartime-nparco
}
# calculate p-value
pval = 1-pf(stat,df1,df2)
stat # F statistic
df1 # n.df
df2 # d.sf
pval # p-value


Thank you very much for the help and support. I hope you are enjoying retirement.

Re: ANODEV function in RMark.

PostPosted: Thu Oct 12, 2023 3:35 pm
by jlaake
Thank you for sharing the code you found. I suggest you consider writing it more generically so any 2 models could be passed to a function that would do the ANODEV. This will make it more useful to others.

You hit me on a grumpy old man day and your "How come?" just struck me the wrong way as in "well why not?" I realize that was not the case and I'm sorry for my harsh response.

This interchange makes me realize that I need to add more material to the phidot sticky notes and reorganize them to cover the material Evan described, where to find documentation/help and citing RMark.

Regards --jeff