ANODEV function in RMark.

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

ANODEV function in RMark.

Postby nesmonde » Mon Oct 09, 2023 8:48 am

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.
nesmonde
 
Posts: 7
Joined: Tue Nov 02, 2021 4:29 pm

Re: ANODEV function in RMark.

Postby jlaake » Mon Oct 09, 2023 9:46 am

No.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: ANODEV function in RMark.

Postby nesmonde » Mon Oct 09, 2023 9:49 am

jlaake wrote:No.


How come?
nesmonde
 
Posts: 7
Joined: Tue Nov 02, 2021 4:29 pm

Re: ANODEV function in RMark.

Postby cooch » Mon Oct 09, 2023 9:58 am

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
cooch
 
Posts: 1652
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: ANODEV function in RMark.

Postby cooch » Mon Oct 09, 2023 10:19 am

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.
cooch
 
Posts: 1652
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: ANODEV function in RMark.

Postby jlaake » Mon Oct 09, 2023 10:46 am

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.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: ANODEV function in RMark.

Postby nesmonde » Wed Oct 11, 2023 1:10 pm

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.
nesmonde
 
Posts: 7
Joined: Tue Nov 02, 2021 4:29 pm

Re: ANODEV function in RMark.

Postby jlaake » Thu Oct 12, 2023 3:35 pm

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
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

cron