Short summary of the problem
code_to_run_your_model(if_applicable)
```#This is not in parallel, so it will take forever
for (i in 15:ntraits) {
cat("Working on trait: ",i, "/c")
dir.create(paste0(i))
setwd(paste0('C:/Users/Marina/Documents/Dropbox/Microbioma IMF/Nuevos datos/Line Effect/',i))
y <- DB[,7+i]
data <- DB[,c(1:7)]
data <- cbind(data,y)
model1<-brm(y~LINEA+WK+SEQ+SEXO+OP+(1|c),data = data,iter=50000,warmup=10000,thin=10,seed=1234)
#write results
write.table(summary(model1)$fixed, file="Fixed_solutions.csv")
write.table(summary(model1)$random, file="Random_solutions.csv")
write.csv(VarCorr(model1)$residual$sd, file="ResidualVar.csv")
#Write the hypothesis
df <- as.data.frame(hypothesis(model1,"LINEA2<0")[1])
df <- rbind(df,as.data.frame(hypothesis(model1,"WK2<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"WK3<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"WK4<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"WK5<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"WK6<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"SEQ2<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"SEXO2<0")[1]))
df <- rbind(df,as.data.frame(hypothesis(model1,"OP2<0")[1]))
write.csv(df, file="Hypoyhesis.csv")
setwd('C:/Users/Marina/Documents/Dropbox/Microbioma IMF/Nuevos datos/Line Effect')
#Graph variances
#jpeg("Variances.jpeg") #Save the graph
#plot(plot(model1, ask = FALSE))
#dev.off()
}
If possible, add also code to simulate data or attach a (subset of) the dataset you work with.
Please also provide the following information in addition to your question:
* Operating System: Windows 10
* brms Version: last version
Looking forward to your topic!