Hi:

To test the situation below I am creating 2 datasets
.#Set working directory
setwd("C://Tina/USB_Backup_042213/Testing/CSV")

matrix=NULL
csvs <- paste("MVN", 1:2, ".csv", sep="")
for(i in 1:length(csvs)){
  matrix[[i]] <- read.csv(file=csvs[i], header=T)
  print(matrix[[i]])
}

So now I have read in 2 simulated datasets which  look like
 Y1 Y2
1 11  6
2  8  5
3 25 13
4  1 13
5  8 22
  Y1 Y2
1  9  1
2  7  9
3 25 13
4  1 18
5  9 12

My next step is to run a multivariate logit normal model on these datasets
and automate this process for 300 such simulated datasets. Heres the model
statement:
model
 {
  for (j in 1 : Nf)

      {
      p1[j, 1:2 ] ~ dmnorm(gamma[1:2 ], T[1:2 ,1:2 ])

      for (i in 1:2)
      {
     logit(p[j,i])<-p1[j,i]

     Y[j,i] ~ dbin(p[j,i],n)
}}

I am trying to use the following code to run it in R2WinBUGS

bugs.output <- list()
for(i in 1:2){                             # for 2 simulated datasets for
now
       *Y <-(matrix[i])*               * *
       bugs.output[[i]] <- bugs(
       data=list(Y=Y, Nf=5), # change for no of sites
    inits=NULL,
       model.file="M-LN_model_trial.txt",
       parameters.to.save = c("p","rho","sigma2"),
n.chains=1, n.iter=12000, n.burnin=5000,
bugs.directory="C://Tina/USB_Backup_042213/winbugs14/WinBUGS14",
working.directory=NULL)}


Any suggestion would be helpful.
Thanks!

	[[alternative HTML version deleted]]

