FDR in INLA

45 views
Skip to first unread message

Prince Michael Amegbor

unread,
Mar 15, 2023, 6:51:54 PM3/15/23
to R-inla discussion group
Hi,

I want to implement FDR test for my INLA model and I came across this paper - Fast and accurate Bayesian model criticism and conflict diagnostics using R-INLA. when I run the inla.cut() function I get the error below:

Error in `[.tbl_df`(data, , split.by == names(data)) :
  object 'ID' not found


my code are as follows:
F1 <- Y ~ Exposure +  ... + f(ID, model = "iid")
M1 <- inla(F1, data=DF,
             family = "binomial", Ntrials = 1, inla.mode='experimental',
             control.predictor = list(compute = TRUE),
             control.family = list(link = "logit"),verbose=TRUE,
             control.inla=list(strategy="adaptive", int.strategy="eb"),num.threads="8:1",
             control.compute=list(openmp.strategy="huge", smtp="default", dic=TRUE, waic=TRUE,cpo=TRUE, return.marginals.predictor=TRUE))




Helpdesk (Haavard Rue)

unread,
Mar 16, 2023, 3:42:20 AM3/16/23
to Prince Michael Amegbor, R-inla discussion group

from the error it seems that 'ID' is not in data 'DF'
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/884239b5-34f7-4106-b3bc-60cf734edf36n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

Prince Michael Amegbor

unread,
Mar 17, 2023, 1:56:34 PM3/17/23
to R-inla discussion group
Thanks,  Håvard.

ID is in the dataframe. I figured the problem was I didn't put ID in quotation marks in the inla.cut call - 
inla.cut(M1, "ID")

However, I got a new error 

Error in `x[order(x, na.last = na.last, decreasing = decreasing)]`: ! Can't subset columns past the end. ℹ Locations 2, 3, 4, …, 7, and 8 don't exist. ℹ There is only 1 column. Run `rlang::last_error()` to see where the error occurred. Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames

Helpdesk (Haavard Rue)

unread,
Mar 17, 2023, 3:41:33 PM3/17/23
to Prince Michael Amegbor, R-inla discussion group

this is old code that I do not know if it will work with
inla.mode="experimental" which is now the new default.

you may try with inla.mode="classic", if that goes through then that is
the issue

otherwise, you can do this manually yourself?



On Fri, 2023-03-17 at 10:56 -0700, Prince Michael Amegbor wrote:
> Thanks,  Håvard.
>
> ID is in the dataframe. I figured the problem was I didn't put ID in
> quotation marks in the inla.cut call - 
> inla.cut(M1, "ID")
>
> However, I got a new error 
>
> Error in `x[order(x, na.last = na.last, decreasing = decreasing)]`:
> ! Can't subset columns past the end.
> ℹ Locations 2, 3, 4, …, 7, and 8 don't exist.
Reply all
Reply to author
Forward
0 new messages