Logistic regression and success probability: Bayesian statistics I have a Bayesian statistics homework question that I'm not sure of:
Running this in R, I got completely flat lines at 0 and 1 so I was thinking this meant that the success probability does not change with this particular prior. Can anyone shed some more light on this problem?
mu0    = 0 
sig2_0 = 100 
n      = 10000 
b0     = rnorm(n, mean=mu0, sd=sqrt(sig2_0)) 
x      = seq(from=0, to=10, length.out=100) 
res    = matrix(0, length(x), 3) 
for(i in 1:length(x)){ 
  z       = b0 
  z1      = exp(z) / (1+exp(z)) 
  res[i,] = quantile(z1, c(0.025, 0.5, 0.975)) 
} 

plot( x, res[,2], type='l', ylim=range(res), ylab='Success probability', xlab='Covariate') 
lines(x, res[,1], lty=3) 
lines(x, res[,3], lty=3)

 A: For some initial hints, consider a logistic regression in a non-Bayesian context.  If the true $B_0$ in some situation were $0$, what would the probability of success be when all $X$ variables were $0$?  Note that $B_0$ is on the logit scale, so you have to convert this into a probability.  
Now, if your prior for $B_0$ were centered on $0$, that implies that in some sense (n.b., there are different positions on what Bayesian priors are supposed to mean) you believe the true value of $B_0=0$ (or at least did, before seeing your data).  
The width of a prior represents your certainty about your prior belief, with wider priors implying greater uncertainty.  The posterior can be understood (very loosely) as a weighted average of your prior and what your data tell you, with the weights being proportional to the width of your prior.  So the result / mean of your posterior for $B_0$ will be partway between $0$ and what the data suggest, being closer to $0$ the narrower your prior and closer to what the data suggest the wider your prior.  
