[R] package R2WinBUGS question; was: Multilevel

martanair marta.nairuscone at unicatt.it
Sat Jan 29 18:20:28 CET 2011


I have R2WinBUGS
and this is my radon1.bug 

# Bugs code for multilevel model for radon
# with bsmt as an individual predictor

# varying-intercept model

model {
  for (i in 1:n){
    y[i] ~ dnorm (y.hat[i], tau.y)
    y.hat[i] <- a[county[i]] + b*x[i]
  }
  b ~ dnorm (0, .0001)
  tau.y <- pow(sigma.y, -2)
  sigma.y ~ dunif (0, 100)

  for (j in 1:J){
    a[j] ~ dnorm (mu.a, tau.a)
  }
  mu.a ~ dnorm (0, .0001)
  tau.a <- pow(sigma.a, -2)
  sigma.a ~ dunif (0, 100)
}



-- 
View this message in context: http://r.789695.n4.nabble.com/Multilevel-tp3246190p3246361.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list