Is there a way to use the RMark parameter combos function modeling approach (Gentle MARK Book: C.13 A More Organized Approach) for a combination of models with share = TRUE and others with share = FALSE? The goal is to test different covariate combos for p with share = TRUE and also the same covariate combos for p and c with share = FALSE. Specifically, I'm using a Huggins closed capture model and applying share to p and c.
If I run something like this then of course share = TRUE works for p and c:
- Code: Select all
model.fun <- function(){
p.age.grp.share <- list(formula = ~age.grp, share = TRUE)
cml <- create.model.list("Huggins")
return(mark.wrapper(cml, data = smamm.proc, ddl = smamm.ddl, adjust = FALSE, output = FALSE, retry = 2))
}
# Run models defined in function
model.list <- model.fun()
This returns one model with p=c and one with p(covariate), c(.):
- Code: Select all
model.fun <- function(){
p.age.grp <- list(formula = ~ge.grp)
p.age.grp.share <- list(formula = ~age.grp, share = TRUE)
cml <- create.model.list("Huggins")
return(mark.wrapper(cml, data = smamm.proc, ddl = smamm.ddl, adjust = FALSE, output = FALSE, retry = 2))
}
# Run models defined in function
model.list <- model.fun()
But, of course, share = TRUE no longer works when you add a formula for c within the function. So, it is not possible to test different covariates for p and c where some models have share = TRUE and some have FALSE, which is the goal.
If it isn't possible as one integrated function, then what about running two separate functions, one for share=TRUE and one for FALSE, for the same set of covariates, and then using collect.models() to collect them all into one AIC table? I realize that doesn't work because, as far as I can tell, you have to run models outside of the function approach for collect.models() to work, but am wondering if there is some similar way or workaround to combine the sets .
Sorry if this is answered elsewhere, please just point me to the post or reference. I haven't found an answer in forum searching or reading of RMark docs, but maybe I just did a bad job searching
Thanks!
Joe