I am conducting a Bayesian analysis in R thorough "R2Winbugs" package. In the R output, teh estimated parameters are rounded. My question is how can I control this?
Here is my command:
bugs(data, inits=inits, model.file =…
I am trying to perform group variable selection on a random intercept model using spike and slab priors in WinBUGS. However, I think it is trapping and I keep getting the error message "NIL dereference (read)" when running my code. I'm not sure…
This is my first time running WinBUGS. My model is fairly simple, with only an intercept and two random effects. However, when I run the model I get a whole list of errors (see below). The first error says "undefined variable". I am having trouble…
I am very new to WinBUGS so I appreciate anyone's help troubleshooting. I used the R2WinBUGS package to run my model. I had originally posted with an issue about a pop-up in WinBUGS that said "incompatible copy". I resolved this issue by shortening…
Can anyone help me with this issue please? I have used other data sets with different number of studies (NS) and treatments (NT) and it worked fine.
Any help will be highly appreciated.
The dataset is as follows:
list(N=186, NS=5, NT=3, mean=c(0,0);…
I am using the following model in WINBUGS to run a hierarchical Bayesian regression where the beta are my covariates:
If I modify this model by adding the following code:
# posterior probabilities of Positive beta's
p.beta0 <- step( beta0 )
p.beta1…
I'm learning R2WinBUGS. I have few doubts. Can anyone please help me in solving it? when I run this example, I get a error saying "ratsmodel1.txt" does not exists. where am I suppose to save my model file code? And how am I suppose to call it from R…
I would like to know how to upload a data set from R packages to winbugs.
In particular, "LearnBayes" package in R has too many data sets. I would like to use one of them in Winbugs.
Can anyone help me with this?
The model is syntactically correct, I loaded the data but when I compile, I get this error : "multiple definitions of node z". I don't know how to solve it
model{
...
for(i in 1:r){
for(j in 1:r){
z[i,j] <-…
I am having issues figuring out how to run some simulation studies using R2WinBUGS. The aim is to simulate n datasets (aiming for 1000, but starting with 10), and put them all into the R2WinBUGS code as a matrix so that when it ports over to…
My data file looks something like this:
list(y=structure(.Data=c(26, 228, 31, ...)), .Dim=c(413,9))
Let's say this file is saved as "data.txt".
If I'm working in 'R2OpenBUGS', it allows me to pass the data as a file with no problem:
mcmc <-…
all!
I am using winbugs to do simple linear regression. However, the system always give the error message, expected a comma.
Here is my model statement:
model {
for (i in 1:I)
{
Z[i] ~ dnorm(beta0 + beta1 * X[i], tau)
}
tau <-…
I am trying to run a model in OpenBUGS. But I am getting an error "Variable TT is not defined". Here is my BUGS code:
model{
for(t in 2:TT){
for(i in 1:N){
y[t,i] ~ dmnorm(y1[t,i], tau[i])
}
y1[t,1] <- (p[1,1] * y[t-1,1]) + (p[1,2]…
I want to explain the convergence in a bugs model with the command plot(). An example of the output is in the follow figure
I don't sure that I can read this output well, thanks to everyone :)