Page 1 of 1

model averaging and region.N

PostPosted: Thu Dec 05, 2013 1:04 am
by bgerber
Dear all:

Is there a way to use model averaged density estimates to thus find the equivalent model averaged population size using the secr function region.N?

Thanks
Sincerely, Brian

Re: model averaging and region.N

PostPosted: Thu Dec 05, 2013 1:11 am
by murray.efford
Brian
Do you mean other than calculating it by hand? That shouldn't be too hard, given you have the estimates of N and their SE from region.N, and the relevant AIC. Admittedly it may be better to average on the log scale, which makes it slightly more tricky.
Murray

Re: model averaging and region.N

PostPosted: Thu Dec 05, 2013 1:13 am
by bgerber
Murray:

Sorry for not being specific. Yes, I was thinking of doing it on the log-scale.

Sincerely, Brian

Re: model averaging and region.N

PostPosted: Thu Dec 05, 2013 1:25 am
by murray.efford
I can't offer an immediate answer - maybe later. I see that region.N uses a function add.cl that is hidden. I'll paste the code below in case you're inspired to extract the transformation.
Murray

Code: Select all
add.cl <- function (df, alpha, loginterval, lowerbound = 0) {
## add lognormal or standard Wald intervals to dataframe with columns
## 'estimate' and 'SE.estimate'
## lowerbound added 2011-07-15
    z <- abs(qnorm(1-alpha/2))
    if (loginterval) {
        delta <- df$estimate - lowerbound
        df$lcl <- delta / exp(z * sqrt(log(1 + (df$SE.estimate /
                        delta)^2))) + lowerbound
        df$ucl <- delta * exp(z * sqrt(log(1 + (df$SE.estimate /
                        delta)^2))) + lowerbound
    }
    else {
        df$lcl <- pmax(lowerbound, df$estimate - z * df$SE.estimate)
        df$ucl <- df$estimate + z * df$SE.estimate
    }
    df
}