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

francogrex francogrex at mail.com
Thu May 3 09:21:30 CEST 2007


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=logpriorfun,shape1=1,shape2=1)

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: http://www.nabble.com/Bayesian-logistic-regression-with-a-beta-prior-%28MCMClogit%29-tf3684970.html#a10300145
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list