unbalanced panel and multidimensional array in Winbugs -
i have model input demand, unbalanced data. dependent variable yijt, i means input of production function (i=1,2,3), j means firm (j=1,..,21), , t means time (ti=1,..,ti). so, because panel unbalanced, 3 equations, correct format use in winbugs?
i tried use in shape of stata long format, 3*107, indexes bit different. row (i) means input , columns (j) form panel i*t. so, no explicit time index. used nested indexing columns, form data 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] input-specific free parameter, u desired firm-specific error component, should estimated on firms (21). use nested indexing, expression of u in model on columns u[firm[j]] , prior u on firms u[k].
here question nested indexing. if model includes many covariates, time-dependent, should use nested indexing of these covariates, otherwise winbugs not take panel?
i tried use multidimensional array multidimensional variables. balancing lot of na-s included. example, dependent variable yijt 3-dimensional array y[ , , ], (using list command), in reason winbugs didn`t recognize na-s? main point posterior distribution not converge, , data formatting 1 of reasons
you better off keep data in long format (with columns y, i, j , t) , rows each response (which have na y have missing data).
the center multilevel modelling have introductory guide on running these types of models in format winbugs [here]
Comments
Post a Comment