Hello,
I am a totally new user of WinBugs. I am interested in estimating a Discrete
Hazard Model using WinBUGs. As you know, the highlight of this model is that
we don't need to estimate nonparametrically the baseline hazard. Instead, we
need to estimate the interval-specific parameters for the baseline hazard.
I am writing to ask if anyone has any opinions or experience on specifying
this model using WinBugs. The following is my code. Please take a look at
and let me know if there are something wrong.
Thanks,
Kang H. Yoon
## Model Specification Part ##
model{
for (i in 1:N) {
mu[i] <- beta[1]*x1[i]+beta[2]*x2[i]
## There are total six intervals and gammas for each interval-specific
param.
cloglog(Q[i,1]) <- mu[i]+gamma[1]
cloglog(Q[i,2]) <- mu[i]+gamma[2]
cloglog(Q[i,3]) <- mu[i]+gamma[3]
cloglog(Q[i,4]) <- mu[i]+gamma[4]
cloglog(Q[i,5]) <- mu[i]+gamma[5]
## Hazard rate when the event happens in any interval
## Interval 6 includes the idea of censoring case
hf11[i] <- equals(y[i],1)*(1-Q[i,1]) + equals(y[i],2)*(1-Q[i,2])
+ equals(y[i],3)*(1-Q[i,3]) + equals(y[i],4)*(1-Q[i,4])
+ equals(y[i],5)*(1-Q[i,5]) + equals(y[i],6)
## survival rate when the event happens in any interval
## for instance, survival = s(1)*s(2)*s(3), when event happens at interval 4
hf12[i] <- equals(y[i],1) + equals(y[i],2)*Q[i,1]
+ equals(y[i],3)*Q[i,1]*Q[i,2]
+ equals(y[i],4)*Q[i,1]*Q[i,2]*Q[i,3]
+ equals(y[i],5)*Q[i,1]*Q[i,2]*Q[i,3]*Q[i,4]
+
equals(y[i],6)*Q[i,1]*Q[i,2]*Q[i,3]*Q[i,4]*Q[i,5]
## Likelihood function for an individual i
likeli[i] <- hf11[i] * hf12[i]
}
## Priors ##
beta[1:8] ~ dmnorm(b0[], V0[,])
gamma[] ~ dnorm(0,1.0E-6)
}
## Model Specification Part ##
list(beta=c(1,1),
gamma=c(0,0,0,0,0))
## Initial Values for Priors ##
list(b0=c(0,0),
V0=structure(.Data=c(0.000001,0
0,0.000001),
.Dim=c(2,2)),N=5)
y[] x1[] x2[]
3 4 3
6 4 4
1 4 5
4 5 1
2 4 4
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
-------------------------------------------------------------------
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
|