I was working on the the guide for calculating the effect size of different treatments using a NETWORK META-ANALYSIS as done in example 6.a.
Here
It works fine in winBugs, but I want to do the analysis in R using R2winugs so that I can automate the…
I am trying to fit a model using OpenBUGS. Here is the code:
model {
# N observations
for (i in 1:N) {
y[i] ~ dbin(p.bound[i],1)
p.bound[i]<-max(0,min(1,p[i]))
logit(p[i])<-Xbeta[i]
Xbeta[i] <-…
I am doing a simple regression model with WinBUGS via R2WinBUGS.
Results appear ok, however WinBUGS keeps showing this line and I don't know why:
command #Bugs:gen.inits cannot be executed (is greyed out)
Does someone have an idea?
Thanks!
The R…
This is just the same question I posted in
CrossValidated, where some considered it off topic. So, I reproduce it here:
I'm using R2WinBUGS to process several datasets in WinBUGS in "batch mode" from R. Occasionally traps occur, mainly due to bad…
I am doing several Bayesian analyses using R2WinBugs so I can put them in a for-loop. It works perfectly, R calls WinBugs, then the simulation starts and when it is done the results are saved and the next analysis starts.
When I normally use…
The R2WinBUGS package has a function called write.model(). The R package rjags has no such function of which I am aware. write.model creates a temporary text file that can be read as a model by WinBUGS.
I know I can enter write.model into the…
I try to use WinBUGS from R via BRugs and R2WinBUGS, the code is followinig:
require(R2WinBUGS)
require(BRugs)
model<-function(){
for(i in 1:N){
y[i] <- x[i] + w[i]
w[i] ~ dnorm(0, sigma.y)
x[i] <- a - b*5 + v[i]
v[i] ~ dnorm(0,…
Is anyone using R2OpenBUGS? Should I rather be using r2winbugs? ...
I am trying to model final (2-year) treatment outcomes (e.g. success, death, default or failure) for my sample of patients with a (single) intermediate (3-month) outcome.…
I'm trying to call WinBUGS from R, but I have not been very successful.
I typed this code in R:
radon.data <- list ("n", "J", "x", "y", "county")
radon.inits <- function (){
list (a=rnorm(J), b=rnorm(1), mu.a=rnorm(1),
sigma.y=runif(1),…
We want to run a given baysian Model for decision making with R and WinBugs. We are using RStudio and R2WinBugs.
The model is given by:
# Search and Stop
model{
# Data
for (i in 1:ns){
for (q in 1:nq){
y[i,q] ~…
I'm new to OpenBUGS and I got some problem in fitting a model with the logit() function.
Reading around I found that one possible solution for this would be explicit specify the logit function without using the WinBUGS’ own logit function:
In…
So I have been working on this code for awhile running hazard models for a population and for one of my initial parameters it cannot figure out how to fix it. This is the area of code that is giving me problems. I am coding in Notebook++, running in…
I really hope this is not a stupid question, but I am trying to simulate a very simple spatial Bayesian model and I keep getting some sort of "incopmatible copy" message on the WinBUGS window.
I am simulating…
I am using the R2WinBugs package. I would like to pass two parameter that are calculated previously in the R script to the model function
c0yy <- 0.1
syy <- 0.0001
#Model
model <- function(c0yy,syy){
#Likelihood
for(i in 1:n){
y[i] ~…