CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDescDocuments.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc TextViews.StdViewDescTextViews.ViewDescTextModels.StdModelDescTextModels.ModelDescTextModels.AttributesDesc'* *#------------------------------------------------------------------------------------------------------------------------------ Version 1: constant model #------------------------------------------------------------------------------------------------------------------------------ model { for (i in 1:n) { for (j in 1:K){ y[i,j] ~ dnorm( mu[i,j], tau ) mu[i,j] <- m } } # prior distributions m ~ dnorm( 0.0, 0.001) tau~dgamma(0.001, 0.001) s2 <- 1/tau s <- sqrt(s2) # # calculation of residuals for (i in 1:n) { for (j in 1:K){ res[i,j]<- y[i,j]-mu[i,j] }} # Calculation of R2 R2 <- 1 - pow( sd(res[1:n,1:K])/sd(y[1:n,1:K]), 2 ) } DATA list(n=20, K=2, y=structure(.Data=c(108, 98, 91, 94, 93, 96, 104, 99, 99, 97, 95, 98, 93, 97, 99, 96, 90, 100, 92, 95, 101, 89, 97, 97, 97, 100, 96, 95, 106, 100, 100, 98, 90, 99, 88, 98, 92, 92, 100, 101), .Dim = c(20, 2) ) ) INITS list(m=0.0, tau=1.0) TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$ ZGo * ,[ @Documents.ControllerDesc t]s ' `h*