[R] Bayesian logistic regression with a beta prior (MCMClogit)

Cody_Hamilton at Edwards.com Cody_Hamilton at Edwards.com
Thu May 3 19:58:53 CEST 2007

Dear Franco,

Have you tried using the beta.start option in MCMClogit?  (The problem may
be where you are starting your chain.)


             <francogrex at mail.                                             
             com>                                                       To 
             Sent by:                  r-help at stat.math.ethz.ch            
             r-help-bounces at st                                          cc 
                                       [R] Bayesian logistic regression    
             05/03/2007 12:21          with a beta prior (MCMClogit)       

Dear all,
I am trying to use the logistic regression with MCMClogit (package:
MCMCpack/Coda) and I want to put a beta prior on the parameters, but it's
giving me error message (please see output below) no matter what shape 1 or
2 I use. It works perfect with the cauchy or normal priors. Do you know if
there is a catch there somewhere? Thanks

logpriorfun <- function(beta,shape1,shape2){
sum(dbeta(beta,shape1,shape2, log=T)) }

posterior <- MCMClogit(nausea~nsaid*diuretic, data=w,
verbose=2000,burnin = 1000, mcmc = 10000,

user.prior.density(beta.start) == -Inf.
Error in MCMClogit(nausea ~ nsaid * diuretic, data = w, verbose = 2000,  :
        Respecify and call MCMClogit() again.

View this message in context:

Sent from the R help mailing list archive at Nabble.com.

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list