back transformed estimates "get-real"

22 views
Skip to first unread message

Madison Thurber

unread,
Aug 14, 2026, 8:51:32 AMAug 14
to oSCR

Hi all,

I’m working on back-transforming parameter estimates from a multi-session oSCR model and am having trouble using get.real() for detection probability.

My top model is:

model8 <- oSCR.fit(model = list(D ~ session, p0 ~ b * sex, sig ~ sex), scrFrame = sf, ssDF = ss, plotit = FALSE, trimS = 8)

The estimated parameter names are:

model8$outStats$parameters [1] "p0.(Intercept)" "p0.male" "p.behav.f" [4] "p.behav.m" "sig.(Intercept)" "sig.sexmale" [7] "d0.(Intercept)" "d.beta.session2" "psi.constant"

I am trying to obtain back-transformed detection estimates and 95% CIs for females before first capture, females after first capture, males before first capture, and males after first capture.

The density get.real worked below:

model8.dens <- get.real(model=model8, type="dens", d.factor=4)

For detection, I tried creating a prediction data frame following the get.real() examples:

model8.det.df <- data.frame( sex=factor(c(0,0,1,1), levels=c(0,1)), b=c(0,1,0,1), p.behav=c(0,1,0,1) ) model8.det <- get.real(model=model8, type="det", newdata=model8.det.df)

but I receive:

Error in eval(g., envir) : object 'p.behav' not found

I also tried using only sex and b in newdata and received the same error.

It looks like the fitted b * sex model is parameterized with separate p.behav.f and p.behav.m parameters, whereas get.real() appears to be looking for p.behav.

Is there a recommended newdata structure or parameter-renaming approach for using get.real() with a p0 ~ b * sex model? I am also trying to obtain the female- and male-specific sigma estimates from sig ~ sex.

Thanks! 

Madison Thurber

unread,
Aug 15, 2026, 8:02:21 AMAug 15
to oSCR

Hi all,

I was able to manually back-transform the parameter estimates from my oSCR model rather than using get.real(). However, I’m wondering if there is a recommended approach for obtaining the corresponding 95% confidence intervals when get.real() is not working.

My model includes p0 ~ b * sex, so some of the real-scale estimates require combining multiple coefficients before back-transforming (for example, the male post-capture detection estimate uses the detection intercept + male effect + male behavioral effect).

Is there a standard/recommended way in oSCR to calculate the confidence intervals for these manually back-transformed combinations of coefficients?

Thanks!
Madi


Chris Sutherland

unread,
Aug 15, 2026, 3:33:15 PMAug 15
to oSCR
Hi Madi, 

See if this works:

dens_nd <- data.frame(Session = 1)
get.real(model = mod, type = "dens", newdata = dens_nd)

p_nd <- data.frame(Session = 1, sex = factor(c(0,1,0,1)),b = c(0,0,1,1))
get.real(mod, type='det', newdata=p_nd)

sig_nd <- data.frame(Session = 1, sex = factor(c(0,1)))
get.real(mod, type='sig', newdata=sig_nd)

Madison Thurber

unread,
Aug 15, 2026, 7:40:42 PMAug 15
to oSCR
Thanks Chris! I replaced mod with my fitted model object and changed Session to lowercase session, since my fitted density model uses D ~ session. I then tried: 

dens_nd <- data.frame(session = 1)
get.real(model = model8, type = "dens", newdata = dens_nd) 

but recieved 
Error in eval(g., envir) : object 'd.beta.session' not found.

My fitted density parameters are:  
"d0.(Intercept)"
"d.beta.session2"  
 
I’m seeing a similar issue for detection, where the fitted model has p.behav.f and p.behav.m, but get.real() looks for p.behav. Does this suggest a parameter-naming issue within get.real() for my multisession model?  
-Madi
Reply all
Reply to author
Forward
0 new messages