我正在从WINBUGS估算以下面板数据模型:
model {
for(i in 1:N){ for (t in 1:T) {
y[i,t]~dnorm(mu[i,t],tau)
mu[i,t]<-
beta1*x1[i,t]+
beta2*x2[i,t]+
beta3*x3[i,t]+
alpha[pid[i]]}}
for(i in 1:N){alpha[pid[i]]~dnorm(alphabar,phi)}
alphabar~dnorm(0.0,0.0001)
beta1~dnorm(0.0,0.0001)
beta2~dnorm(0.0,0.0001)
beta3~dnorm(0.0,0.0001)
tau~dgamma(0.01,0.01)
phi~dgamma(0.01,0.01)
}
当我尝试以矩形格式加载数据时会显示一条错误消息:预期的逗号(y []旁边的光标):
pid[] y[] x1[] x2[] x3[]
1 9.593559871 0 -0.443597636 6.88096801
1 8.633731008 0 -0.633257473 6.538920646
1 8.116118432 0 -0.858906415 6.375164245
1 9.255409335 0 -0.724801311 6.52249918
1 NA 0 NA NA
15 NA 13.11252312 NA NA
15 13.72839263 13.04181471 -0.724336386 7.109578571
15 13.62554546 13.24040771 -0.707439066 7.198946524
15 13.86061298 13.32195495 -0.705991918 7.212687311
END
如何解决错误?
请帮忙!