INLA Logistic Regression predicting all 1s or 0s

184 views
Skip to first unread message

JJ Hubbard

unread,
Sep 6, 2022, 12:59:02 PM9/6/22
to R-inla discussion group
Hello,

I am fitting a logistic regression model, but am having difficulty getting sensible predictions.

This is my simple model:

model <- inla(binary_response ~ 1

    + Fixed_Effect1
   
    , data=df2, family="binomial"
    , Ntrials=1
    , control.compute=list(return.marginals.predictor=TRUE, cpo=TRUE, waic=TRUE, dic=TRUE, config=TRUE)
    , control.inla=list(strategy="adaptive",  int.strategy="auto")
    , control.family=list(link='logit'),
    , control.predictor=list(link=1, compute=TRUE)
    , verbose=F
    )

But all predictions are positive, so after transforming them with the logistic function my predictions are all 1. If I comment out the `control.predictor=list(link=1, compute=TRUE)` I get all positive predictions for my training set, and all negative predictions for my test set.

For my test set I simply set the target values to NA.

Thank you

Helpdesk

unread,
Sep 6, 2022, 1:35:20 PM9/6/22
to JJ Hubbard, R-inla discussion group
You check 'fitted values', right?
> --
> 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/f5e3ffaa-fa33-4a67-bde2-364a83fdfe15n%40googlegroups.com
> .

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

JJ Hubbard

unread,
Sep 6, 2022, 1:42:05 PM9/6/22
to R-inla discussion group
Correct, model$summary.fitted.values
Reply all
Reply to author
Forward
0 new messages