title: unbalanced panel and multidimensional array in Winbugs
body: <p>I have a model for input demand, with unbalanced data. The dependent variable is <code>yijt</code>, where <code>i</code> means input of production function <code>(i=1,2,3)</code>, <code>j</code> means firm <code>(j=1,..,21)</code>,  and <code>t</code> means time <code>(ti=1,..,Ti)</code>.  So, because the panel is unbalanced, with three equations, what could be the correct format to use it in winbugs?</p>
  
  <p>I tried to use it in shape of STATA long format,  3*107, where indexes are a bit different. Row (<code>i</code>) means an input and columns (<code>j</code>) form a panel <code>i*t</code>. So, no explicit time index. I used nested indexing for columns, to form data as a panel. Little piece of code:</p>
  
  <pre><code>for (i in 1:3){
       for(j in 1:107){
            log(mu[i,j]) &lt;- a[i]+ u[firm[j]]+...
  </code></pre>
  
  <p>where <code>a[i]</code> is an input-specific free parameter, <code>u</code> is a desired firm-specific error component, which should be estimated over firms (21). For this I use nested indexing, where expression of u in the model is over columns <code>u[firm[j]]</code> and prior for <code>u</code> is over firms <code>u[k]</code>. </p>
  
  <p>Here is the question about nested indexing. <strong>If the model includes many covariates, which are also time-dependent, should I use nested indexing for all of these covariates, otherwise Winbugs does not take it as a panel?</strong> </p>
  
  <p>I tried to use a multidimensional array for all multidimensional variables. For balancing a lot of NA-s were included. For example, dependent variable yijt is an 3-dimensional array <code>y[ , , ]</code>, (using list command), but in some reason Winbugs didn`t recognize NA-s? 
  Main point is that posterior distribution does not converge, and data formatting could be one of the reasons</p>