# Dummy variable in OpenBugs

#### Eddie2004

##### New Member
I have data on survival analysis to compare two treatments. Survival time is weibull distributed. I have problem with formulating the model . Treatment is a dummy variable with two levels (1,2) and I don't know how to incorporate it to be able to compare efficacy.

Any suggestion with this issue!

Thanks

model{
for(i in 1:N){
t ~ dweib(rho, mu)
mu <-exp( beta0 + beta1*size +beta2*treatment )
}
beta0 ~ dnorm(0,0.0001)
beta1 ~ dnorm(0,0.0001)
rho ~ dgamma(1.0,0.0001)
}

#### hlsmith

##### Less is more. Stay pure. Stay poor.
Not completely my area. This isn't a proposrtional hazards model right? Since you are defining that above in your likelihood. In HR models treatment estimates would be hazard ratios and treatment would take on a normal dist.

Also, openBUGS, above, you are defining the mean and then std or var or precision? What does the 0.0001 represent in that language? I am guessing precision such they are some small. So you are currently using flat non-informative priors?

#### Eddie2004

##### New Member
That's the hazard function. h(ti) = h0(ti) × h1(ti) but h1(ti) is the focus of modeling. Priors are non-informative. rho and mu are scale and shape paramaters of weibull. This is just a starting model and there is a possibility to model log(mu). Modelling mu can tell about the hazard under each treatment and that's what came across when searching. In SAS I can take treatment 1 as a baseline in model specification at coding but I don't know how openBUGS handles that. At this stage my problem how to handle in openBUGS my most important covariate being categorical with two levels.

Thank you

model{
for(i in 1:N){
t ~ dweib(rho, mu)
mu<-exp( beta0 + beta1*size +beta2*treatment )
}
beta0 ~ dnorm(0,0.0001)
beta1 ~ dnorm(0,0.0001)
rho ~ dgamma(1.0,0.0001)
}

#### fed2

##### Active Member
if its anything like proc mcmc you need to set like
beta0 + beta1*size +beta2*(treatment == 2)