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

From: <Cody_Hamilton_at_edwards.com>
Date: Thu, 03 May 2007 10:58:53 -0700

Dear Franco,

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

Regards,

   -Cody

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





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.


______________________________________________
R-help_at_stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help_at_stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Thu 03 May 2007 - 18:27:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 May 2007 - 22:32:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.