Hi:
I have used unbalanced programs for a long time with winbugs - but I am getting
an error that never happened before.
The error says: "made use of undefined node sek"
In the code below you will see that I define "sek" in line 9. I have rewritten
the program twice, but I still get the same error. If need be I can send other
programs with similar structure but no error.
I would appreciate any help/suggestions.
Best
Raj
CODE:
Poisson-Normal Model - industry specific
model {
# First define distribution and then paremetrize it
for (n in 1:N){
tou[n] ~ dpois(mu[ind[n],frm[n],yr[n]]);
sek[ind[n],frm[n],yr[n]] <- seek[n];
fr[ind[n],frm[n],yr[n]] <- fru[n];
strt[ind[n],frm[n],yr[n]] <- start[n];
fee[ind[n],frm[n],yr[n]] <- fees[n];
ry[ind[n],frm[n],yr[n]] <- roy[n];
fn[ind[n],frm[n],yr[n]] <- fin[n];
rk[ind[n],frm[n],yr[n]] <- rnk[n];
ag[ind[n],frm[n],yr[n]] <- age[n];
fag[ind[n],frm[n],yr[n]] <- fage[n];
cex[ind[n],frm[n],yr[n]] <- cexp[n];
tou_lag[ind[n],frm[n],yr[n]] <- tou1[n];
N0[ind[n],frm[n],yr[n]] <- N01[n];
tim[ind[n],frm[n],yr[n]] <- time[n];
}
for (i in 1:I) { #industries
for (f in fstrt[i]:fend[i]){ # firms
for (t in tstrt[f]:tend[f]){ # number of years, firm specific
log(mu[i,f,t]) <- alpha[f] + gamma[t] + a[i,1]*sek[i,f,t] +
a[i,2]*strt[i,f,t] + a[i,3]*fee[i,f,t] + a[i,4]*ry[i,f,t] + a[i,5]*fn[i,f,t] +
a[i,6]*rk[i,f,t] + a[i,7]*ag[i,f,t] + a[i,8]*fag[i,f,t] + a[i,9]*cex[i,f,t];
}
}
}
for (i in 1:I) {
a[i,1:9] ~ dmnorm(mu.a[],w.a[,])
b[i,1:9] ~ dmnorm(mu.b[],w.b[,])
}
mu.a[1:9] ~ dmnorm(ma[],pa[ , ])
mu.b[1:9] ~ dmnorm(mb[],pb[ , ])
w.a[1:9 , 1:9] ~ dwish(Omega[ , ], 9)
w.b[1:9 , 1:9] ~ dwish(Omega[ , ], 9)
ma[1:9] ~ dmnorm(mean[],prec[,])
mb[1:9] ~ dmnorm(mean[],prec[,])
pa[1:9 , 1:9] ~ dwish(Omega[ , ], 9)
pb[1:9 , 1:9] ~ dwish(Omega[ , ], 9)
for (f in 1:F){
alpha[f] ~ dnorm(0, 1.0E-07)
}
for (t in 1:T) {
gamma[t] ~ dnorm(0, 1.0E-07)
}
}
Rajdeep Grewal, Ph.D.
Dean's Faculty Fellow and Associate Professor of Marketing
Associate Research Director ISBM (www.isbm.org)
The Smeal College of Business
The Pennsylvania State University
407 Business Bldg.
University Park, PA 16802
-------------------------------------------------------------------
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
|