I have a model for input demand, with unbalanced data. The dependent variable is yijt, where i means input of production function (i=1,2,3), j means firm (j=1,..,21), and t means time (ti=1,..,Ti). So, because the panel is unbalanced, with three equations, what could be the correct format to use it in winbugs?
I tried to use it in shape of STATA long format, 3*107, where indexes are a bit different. Row (i) means an input and columns (j) form a panel i*t. So, no explicit time index. I used nested indexing for columns, to form data as a panel. Little piece of code:
for (i in 1:3){
for(j in 1:107){
log(mu[i,j]) <- a[i]+ u[firm[j]]+...
where a[i] is an input-specific free parameter, u 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 u[firm[j]] and prior for u is over firms u[k].
Here is the question about nested indexing. 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?
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 y[ , , ], (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