[R] WinBUGS with R

BXC (Bendix Carstensen) bxc at steno.dk
Mon Aug 25 12:32:56 CEST 2008


Artimon,

It seems that you have got the data wrong: The data structure is a list of 4 characters:

> list("y","X","n","m")
[[1]]
[1] "y"

[[2]]
[1] "X"

[[3]]
[1] "n"

[[4]]
[1] "m"

And that is hardly what you want, presumably you meant

list("y"=y,"X"=X,"n"=n,"m"=m)

??
______________________________________________

Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2-4
DK-2820 Gentofte
Denmark
+45 44 43 87 38 (direct)
+45 30 75 87 38 (mobile)
bxc at steno.dk   http://www.biostat.ku.dk/~bxc

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Aug 22 19:15:17 CEST 2008

artimon wrote:
> Dear Users,
> I am new to both of things, so do not blame me too much...
>
> I am busy with semiparametric regression and use WinBUGS to sample
> posteriors.
> The code to call Winbugs is as follows:
>
> data          <- list("y","X","n","m") #My variables
> inits.beta    <- rep(0,K)
> inits.beta0   <- 0
> inits         <- function(){list(beta=inits.beta,beta0=inits.beta0,taueps=1.0E-3)}
> parameters    <- list("sigma","beta","beta0","y.star")
> fitm          <- bugs(data,inits,parameters,model.file="model.bug",
>                   n.chains=3, n.iter=n.iter, n.burnin=n.burnin, n.thin = n.thin,
>                   debug=FALSE,DIC=FALSE,digit=5,codaPkg=FALSE,
>                   bugs.directory="C:/Program Files/WinBUGS14/")
 >
> but I always get the following error:
> Error in FUN(X[[1L]], ...) :
>   .C(..): 'type' must be "real" for this format
>
>
> I tried the web, but failed. Could anyone give me a clue?
> Best!
>


- Your example is not reproducible for us (without the data).
- Is WinBUGS runnign correctly (see its output with debug=TRUE)?
- What does traceback() tell us?

Which versions of R, WinBUGS and R2WinBUGS are in use?

Uwe Ligges



More information about the R-help mailing list