[R] package R2WinBUGS question; was: Multilevel

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Jan 30 12:16:22 CET 2011



On 29.01.2011 19:27, Ben Bolker wrote:
> Uwe Ligges<ligges<at>  statistik.tu-dortmund.de>  writes:
>
>> On 29.01.2011 15:06, martanair wrote:
>
>    [snip]
>
>>> I write:
>>> 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), sigma.a=runif(1))
>>> }
>>> radon.parameters<- c ("a", "b", "mu.a", "sigma.y", "sigma.a")
>
> [snip]
>
>>>    # with 500 iterations
>>> radon.bugs.1<- bugs (radon.data, radon.inits, radon.parameters,
>>> "radon.1.bug",
>>>       n.chains=3, n.iter=500)
>>
>> We still do not have radon1.bug.
>>
>>> plot (radon.bugs.1)    # to get Figure 16.1
>>> print (radon.bugs.1)   # to display the results in the R console
>>>
>>> But after this
>>>    # with 10 iterations
>>> radon.1<- bugs (radon.data, radon.inits, radon.parameters, "radon.1.bug",
>>> n.chains=3, n.iter=10)
>>>
>>> R programe give me an error:
>>> Errore in FUN(X[[1L]], ...) : oggetto "n" non trovato
>
>    As Uwe said, this seems very unlikely.  If you can show us
> a clean, reproducible example we may be able to help.  There's
> no obvious reason why the variable n should have existed at the
> time of your first run (radon.bugs.1) and then disappeared in
> the process of running plot(radon.bugs.1); print(radon.bugs.1).
>
>    I suspect you are working through material from Andrew Gelman's
> book (since he has some radon examples)?
>
>   [Uwe: one reason to chop out previous code/data is that if
> one posts via gmane, it complains if you don't have enough 'new
> stuff'.  Sigh.]

Well, then the answer seems to be "don't use gmane" if it does restrict 
its users in such a way. Looks like I am too old fashioned ....

Best,
Uwe




>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list