Hi,
I have a panel data with 9 countries and 8 periodes, then N=9 and T=8. "model check" and "data load" are all ok,
but when I "compile", a problem with: "array index is greater than array upper bound for debt!"
What should I do then?
Any help in this regard is highly appreciated.
Does the format of my data is exactly the same as S-Plus format? (Please see bellow my data presentation).
this my model code:
model {
for (i in 1:9){
for (t in 1:8){
Y[i,t,1] <-suicides[i,t]
Yd[i,t] <-yields[i,t]
Y[i,t,2] <-BtCotton[i,t]
Pe[i,t] <-pesticides[i,t]
Db[i,t] <-debt[i,t]
Y[i,t,1:2] ~ dmnorm(mu[i,t,1:2], tau[1:2,1:2])
mu[i, t,1] <- theta[1,i]* yields[i,t] + beta[1,i]*mu[i,t,2] + beta[2,i]*pow(mu[i,t,2],2) + theta[2,i]* pesticides[i,t] + alpha[i]
mu[i, t, 2] <- gamma[i]*debt[i,t] +lambda[i]
}
}
for (i in 1:9){
alpha[i]~ dnorm(0.0, 0.001)
lambda[i]~ dnorm(0.0, 0.001)
theta[1,i]~ dnorm(0.0, 0.001)
theta[2,i]~ dnorm(0.0, 0.001)
beta[1,i]~dnorm(0.0,0.001)
beta[2,i]~dnorm(0.0,0.001)
gamma[i]~ dnorm(0.0, 0.001)
}
tau[1:2,1:2] ~dwish(R[,],2)
R[1,1]<- 0.01
R[1,2]<- 0.0
R[2,1]<-0.0
R[2,2]<-0.01
sigma[1:2,1:2]<-inverse(tau[1:2,1:2 ])
}
The form of my data presentation is
suicides[,1] yields[,2] BtCotton[,3] pesticides[,4] debt[,5]
8.44333134 5.25227343 3.40119738 8.22255364 10.49399274
8.63319687 5.73979291 5.29831737 8.12710919 10.54294613
8.47073032 5.36129217 6.40852879 8.0163179 10.59189952
8.43054538 5.61312811 7.51752085 8.07028089 10.64085291
8.4441923 5.79909265 7.9373747 8.06871619 10.6898063
8.40312824 5.81413053 8.04878828 8.02289687 10.73875969
8.45446636 5.7235851 8.13035355 7.78322402 10.78771307
8.51879191 5.79605775 8.22228507 8.4422541 10.83666646
8.355615 6.32256524 2.30258509 8.21770841 10.80958652
8.51919119 6.15060277 4.31748811 7.61775958 10.86499748
8.59877318 6.26720055 5.6347896 7.66528472 10.92040844
8.58429093 6.44571982 6.7214257 7.59940133 10.9758194
8.57565076 6.5366916 6.99393298 7.23993259 11.03123037
8.50289141 6.46769873 7.18538702 7.34018684 11.08664132
8.41338702 6.39024067 6.95559261 7.23056315 11.14205229
8.4749118 6.48157713 7.52940646 6.92264389 11.19746325
7.48211892 5.42934563 1.38629436 7.90100705 10.12250259
7.06731985 5.56452041 2.89037176 7.43366654 10.17028168
6.86484778 5.59098698 3.40119738 7.69621264 10.21806076
7.09174212 5.59842196 4.44265126 7.40123126 10.26583984
6.69826805 5.82008293 4.97673374 7.21670949 10.31361892
7.158514 5.92692603 5.48063892 7.37023064 10.361398
7.06731985 5.88053299 5.6094718 7.42356844 10.40917709
7.0184018 5.91350301 5.89715387 7.40671073 10.45695617
7.64300364 6.33682573 2.56494936 6.93342303 10.37692279
7.63094658 6.15697899 4.38202663 4.12713439 10.44060006
7.19518732 6.20253552 4.98360662 6.61873898 10.50427734
7.17548971 6.22455843 5.7365723 6.66822825 10.56795461
7.24208236 6.29156914 6.2146081 6.86380339 10.63163189
7.53476266 6.19440539 6.42971948 6.54534966 10.69530916
7.61628356 6.04500531 6.43133108 6.49677499 10.75898644
7.61529834 6.1717006 6.53378884 6.46925032 10.82266372
7.02108396 6.24610677 3.58351894 8.41183268 9.885527227
7.03174126 6.47850964 4.80402104 8.29404964 9.953675568
6.78105763 6.67708346 5.01063529 7.97246602 10.02182391
7.17165682 6.5971457 6.15273269 7.90100705 10.08997225
7.22475341 6.64898455 6.81124438 7.88983375 10.15812059
7.30317005 6.47697236 7.21523998 7.8860814 10.22626893
7.28207366 6.453625 7.42773884 7.88231492 10.29441728
7.30249642 6.54103 7.63240113 7.91935619 10.36256562
7.39939808 6.42810527 1.94591015 8.11552088 10.27346364
7.55642797 6.58617165 1.60943791 7.26822302 10.32364665
7.47590597 6.50428817 3.29583687 7.81035268 10.37382965
7.29165621 6.74523635 3.80666249 7.70120018 10.42401265
7.40549566 6.53233429 4.24849524 8.278936 10.47419566
7.49942329 6.65929392 4.49980967 7.62461899 10.52437866
8.40804774 6.6147256 4.69134788 7.74802852 10.57456166
8.60465447 6.56948142 4.39444915 7.75576717 10.62474467
3.8918203 5.96357934 0 8.88183631 9.398395461
3.61091791 6.31173481 0 8.82173238 9.458343523
3.97029191 6.41345896 2.99573227 8.83927669 9.518291588
3.98898405 6.51025834 4.27666612 8.632306 9.578239651
3.91202301 6.33327963 5.42495002 8.69533938 9.638187712
4.24849524 6.33682573 5.6347896 8.71275997 9.698135778
4.44265126 6.11368218 6.02586597 8.65869275 9.758083842
4.46590812 6.26909628 6.06842559 8.66733585 9.818031908
6.63856779 6.11368218 0 8.07090609 10.23379799
6.59850903 6.05678401 0 7.7419679 10.27343554
6.60529792 5.98393628 2.99573227 7.39510755 10.31307309
6.7129562 6.0799332 4.27666612 6.91572345 10.35271064
6.7214257 6.02827852 5.42495002 8.17948019 10.39234818
6.43775165 6.04500531 5.6347896 8.24380842 10.43198573
6.60529792 6.04263283 6.02586597 8.11162808 10.47162328
6.87523209 6.06842559 6.06842559 8.16820293 10.51126083
6.00881319 5.91889385 0 8.51959032 9.242807562
5.69035945 6.04973346 0 8.46168048 9.290945036
4.74493213 5.93753621 2.99573227 8.41626727 9.339082514
5.61312811 6.17586727 4.27666612 8.4250779 9.38721999
5.89440283 6.26909628 5.42495002 8.43381158 9.435357463
5.36129217 6.25766759 5.6347896 8.38708451 9.483494934
5.32787617 6.20455776 6.02586597 8.3635757 9.531632413
5.35185813 6.27098843 6.06842559 8.31139828 9.579769887
END
Best regards
-------------------------------------------------------------------
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]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
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
|