Dea Winbugs users,
I would like to receive the answer the question: Unbalanced data in a
hierarchical model ( Gerdien Van Schaik ).
Teresa Cristina
-----Mensagem original-----
De: Gerdien Van Schaik <[log in to unmask]>
Para: [log in to unmask] <[log in to unmask]>
Data: Thursday, August 23, 2001 4:39 PM
Assunto: Unbalanced data in a hierarchical model
>Dear Winbugs users,
>
>I am running a hierarchical model in Winbugs of testdata of farms within
>region within country. I have unbalanced data because I have a different
>number of farms per region and per country. Country 1 has 4 regions and 91,
>97, 93, and 97 farms per region. Country 2 has 3 regions with 30 farms in
>each region. I am interested in the region and country effect and therefore
>combined the two datasets.
>My datastructure is a rectangular array and looks as follows:
>
>ncows[,1,1] probpos[,1,1] ncows[,2,1] probpos[,2,1] ncows[,3,1]
> probpos[,3,1] ncows[,4,1] probpos[,4,1] ncows[,1,2]
>probpos[,1,2] ncows[,2,2] probpos[,2,2] ncows[,3,2]
>probpos[,3,2] ncows[,4,2] probpos[,4,2]
>
>with the data underneath the headings in columns.
>
>In my model the hierarchy is modeled with the arrays i (=farm), j
>(=region), and k (=country). See a sample of the model below.
>
>model;
>{
>for( i in 1 : 97 ) {
>for( j in 1 : 4 ) {
>for( k in 1 : 2 ) {
>
> AP[i , j , k] ~ dbin(probpos[i, j, k], ncows[i , j , k])
>
> }
> }
> }
>}
>
>However, to be able to run this model I had to make the data balanced by
>artificially creating 4 regions in every country and 97 farms in every
>region. I would rather not have to create extra data because I may
>introduce errors by doing so.
>Can anybody help me with an array or data-structure that would solve my
>problem with different numbers of regions per country and different number
>of farms per region? I would be very obliged.
>
>Gerdien van Schaik
>
>***************************************************************************
********
>Ms. Gerdien van Schaik, PhD
>Cornell University,
>College of Veterinary Medicine
>Department of Population Medicine and Diagnostic Sciences (box 26),
>Ithaca, NY, 14853,
>USA.
>ph. 607 253-4329
>fax 607 253-3083
>***************************************************************************
********
>
>-------------------------------------------------------------------
>To mail the BUGS list, mail to [log in to unmask]
>You can search old messages at www.jiscmail.ac.uk/lists/bugs.html
>To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
>If this fails, mail [log in to unmask], NOT the whole list
>
>This list is for discussion of modelling issues and the BUGS
>software. For help with crashes and error messages, first mail
>[log in to unmask]
>
-------------------------------------------------------------------
To mail the BUGS list, mail to [log in to unmask]
You can search old messages at www.jiscmail.ac.uk/lists/bugs.html
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
This list is for discussion of modelling issues and the BUGS
software. For help with crashes and error messages, first mail
[log in to unmask]
|