[R] Hierarchical models in R
francogrex
francogrex at mail.com
Mon May 14 20:40:59 CEST 2007
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.
More information about the R-help
mailing list