CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDesc Documents.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc TextViews.StdViewDescTextViews.ViewDescTextModels.StdModelDescTextModels.ModelDescTextModels.AttributesDesc'* *n"#------------------------------------------------------------------------------------------------------------------------------ Version 1: hierarchical #------------------------------------------------------------------------------------------------------------------------------ model { for (t in 1:YEARS){ # stochastic part of the likelihood y[t] ~ dbin( pi[t], N[t] ) # link function logit(pi[t]) <- theta[t] # 1st stage of the prior theta[t] ~ dnorm( mu.theta, tau.theta) } # hyper-prior mu.theta~dnorm( 0, 0.001) tau.theta~dgamma( 0.01, 0.01) s.theta <- sqrt(1/tau.theta) p.theta <- 1/(1+exp(-mu.theta)) } DATA list(YEARS=8) y[] N[] 554 1183 701 1510 749 1597 868 1924 516 1178 573 1324 978 2173 399 845 END INITS list(mu.theta=0.5, tau.theta=1.0) #------------------------------------------------------------------------------------------------------------------------------ Version 2: fixed effects #------------------------------------------------------------------------------------------------------------------------------ model { for (t in 1:YEARS){ # stochastic part of the likelihood y[t] ~ dbin( pi[t], N[t] ) # link function logit(pi[t]) <- theta[t] # 1st stage of the prior theta[t] ~ dnorm( 0.0, 0.001) } mu.theta <- mean( theta[] ) s.theta <- sd( theta[] ) p.theta <- 1/(1+exp(-mu.theta)) } INITS list( theta=c(0,0,0,0,0,0,0,0) ) TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$ ZGo * ,[ @Documents.ControllerDesc t]s ' `h*