I am using the rjags R library. The function coda.samples produces an mcmc.list, for example (from example(coda.samples)):
library(rjags)
data(LINE)
LINE$recompile()
LINE.out <- coda.samples(LINE, c("alpha","beta","sigma"),…
I am new to WinBUGS/OpenBUGS and having difficulty debugging my code.
Does anyone know of a list of potential error messages for BUGS models and their meanings in plain English?
I am currently working on a meta-analysis of survival data across several clinical trials.
To do this, I have code from a published analysis using the same methodology. However, when running this code using the data from the published analysis, I…
I am just wondering whether anyone has some R code that uses the package R2WinBUGS to run logistic regression - ideally with simulated data to generate the 'truth' and two continous co-variates.
Thanks.
Christian
PS:
Potential code to generate…
I've been tasked with re-running someone else's model with updated data (I did the data update and formatting). I understand how the model works but didn't write it, and it's quite long and detailed. On top of that, I exclusively use JAGS and this…
I am very new statistical analysis world and have taken a recent interest in the BUGS/JAGS/STAN modelling language. Something which really surprises me is that I haven't seen any examples of new functions or distributions being defined to avoid code…
I'm working on a binomial mixture model using OpenBUGS and R package R2OpenBUGS. I've successfully built simpler models, but once I add another level for imperfect detection, I consistently receive the error variable X is not defined in model or in…
I'm trying to model the observation "time" as random variable with OpenBUGS via R (R2OpenBUGS). If all the observation times are available (no NA's) everything works, but if I set one of the times to NA, nothing happens. I tested the same code with…
I have run a looong computation in WinBUGS (million iterations) using the R2WinBUGS package from within R:
bugs.object <- bugs(...)
but the R crashed. How do I reload the bugs.object into R again without running winbugs again? I tried this (I have…
I have WinBUGS models below which I need to use in R. However because I am not familiar with WinBUGS and for consistency with other parts of the analysis, I would appreciate any help to convert them to rstan.
Here are the models and data (full…
I'm trying to duplicate some code and am running into troubles with WinBUGS. The code was written in 2010 and I think that back then, the package was installed with additional files which R is now looking for and can't find (hence the error), but…
I'm trying to run a bayes model through R using R2WinBugs and BRugs but running into an error which I cannot solve. I've checked that my model is syntactically correct, and this is the output from when I try running (example below):
model is…
I used Winbugs from R via R2WinBUGS and BRugs package, I write the model and try to run it, but the result didn't come out, and I read the WinBUGS log, seems nothing got wrong.
Here is the model:
require(BRugs)
require(R2WinBUGS)
# MCMC…
I am trying to use R2WinBUGS using this example:
code
(Please only consider the part: ### 5.4. Analysis using WinBUGS)
I am getting this error message:
Error in file(con, "wb") : cannot open the connection
In addition: Warning messages:
1: In…
I am trying to implement the following model written for WinBUGS in JAGS:
model {
for (i in 1:N) {
wtp[i] ~ dweib(r[G[i]], mu[i])I(lower[i], upper[i])
mu[i] <- exp(beta[G[i]])
G[i] ~ dcat(P[])
} …