Hello,
I have a sample of subjects that are treated with two different treatments (one is control treatment). I use different means and variances for the treatments, and I want to test if there is a change in the mean (or actually the probability of a difference in the means). I tried to use the step function on the function diff = control - treat, but when I run this model on simulated data that is the same for both treatments I get a probability of 0.5 for a difference. I would be glad if someone could help me clear this up. Code is below.
Best regards,
Patrik Waldmann
model
{
# Priors
control ~ dnorm( 0.0,1.0E-6)
treat ~ dnorm( 0.0,1.0E-6)
tau.control ~ dgamma( 0.001,0.001)
tau.treat ~ dgamma(0.001,0.001)
tau.ind ~ dgamma( 0.001,0.001)
# Likelihood
for( i in 1 : 50 ) {
mutreat[i , 1] ~ dnorm(control,tau.control)
mutreat[i , 2] ~ dnorm(treat,tau.treat)
}
for( i in 1 : 50 ) {
for( j in 1 : 2 ) {
for( k in 1 : 5 ) {
Y[i , j , k] ~ dnorm(mutreat[i , j],tau.ind)
}
}
}
# Logical functions
diff <- control-treat
q <- step(diff)
p <- 1-q
sigma2.control<-1/tau.control
sigma2.treat<-1/tau.treat
sigma2.ind<-1/tau.ind
}
-------------------------------------------------------------------
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
|