[R] Hierarchical models in R

Cody_Hamilton at Edwards.com Cody_Hamilton at Edwards.com
Mon May 14 20:49:17 CEST 2007


Franco,

What about calling the BUGS model below from R using BRUGS?

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] Hierarchical models in R        
             05/14/2007 11:40                                              
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           





Is there a way to do hierarchical (bayesian) logistic regression in R, the
way we do it in BUGS? For example in BUGS we can have this model:
model
{for(i in 1:N) {
             y[i] ~ dbin(p[i],n[i])
             logit(p[i]) <- beta0+beta1*x1[i]+beta2*x2[i]+beta3*x3[i]
             }
             sd ~ dunif(0,10)
             tau <- pow(sd, -2)
             beta0 ~ dnorm(0,0.1)
                beta1 ~ dnorm(0,tau)
             beta2 ~ dnorm(0,tau)
             beta3 ~ dnorm(0,tau)
}
where we put a prior on the parameters betas, but the sd of the priors is
determined along with the parameters in a full bayesian model. I know that
there are MCMC packages in R but I didn't see one that can do the
hierarchical stuff. Thanks

--
View this message in context:
http://www.nabble.com/Hierarchical-models-in-R-tf3754157.html#a10609656
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.



More information about the R-help mailing list