--
You received this message because you are subscribed to the Google Groups "oSCR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_package...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CAGSCbgpR1GZJenxTY31t-VCgKbNiN6d0a0tvenWxh4f03GDr-Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CANjB3vQHvDUfc60_Dtis-r42e5rk2azo7HoA2MXUbVNwy6Sztw%40mail.gmail.com.
Hi Dan,
Hmm, okay. Any chance you could send me along the m7 object?
Chris
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CAGSCbgo2y6E6yuw4tg-0Gq9sM4R5VczjUnvosBuRNsbp6hDSGQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/008101d66ea7%243191a270%2494b4e750%24%40gmail.com.
Hi Dan and everyone,
So this issue was, indeed, related to estimating and predicting session specific sex ratios. A couple of things before the solution:
Okay, the fix (very cool application by the way!):
#-----------------------------------------------------------------------------#
# update your oSCR, i pushed a fix to the git repo
library(oSCR)
library(ggplot2)
#--------------------------- A HACK ------------------------------------------#
# - because the density covariate is categorical, this works okay
# - note in this specific case, not all categories are present in each
# session, so I recommend removing those
# - basically we create a new ssDF with one that has a similar structure to
# the 'newdata' object, but is a list rather than a data frame (the list
# structure is required, for now, to get session specific psi's)
levs <- c("burnchap","burnfor","chaparral","forest","serpentine")
ses <- 1:7
m7_forPred <- m7
pred_ss <- m7$ssDF
for(i in ses){
df <- data.frame(cov = factor(levs, levels = levs),
session=factor(i, levels=ses),
X=i, Y=i)
pred_ss[[i]] <- df
}
m7_forPred$ssDF <- pred_ss
gr <- do.call(rbind,get.real(model=m7_forPred, type="dens"))
gr$session <- factor(rep(ses,each=10))
gr$cov <- factor(rep(levs,14))
ggplot(gr,aes(x=session,y=estimate,group=sex, color=sex)) +
geom_errorbar(aes(ymin=lwr,ymax=upr),position=position_dodge(0.5),width=0) +
geom_line(linetype=2) +
geom_point(position = position_dodge(0.5),size=4) +
facet_wrap(.~cov) +
theme_bw()

To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CAGSCbgra7%2BzGNENGi%2BtC%2B7OuPhS5NkTNyCzm1kbKJ18g1LSt9A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/007701d66f04%241ac70050%24505500f0%24%40gmail.com.