Shravan - 2014-01-10

The answer is that yes, this model correctly specifies that the correlation between intercepts and slopes is 0.

We can also define the model differently, without using any variance-covariance matrix, because the variance components for intercepts and slopes are independent:

cat("
model
{
# Intercept and slope for each person, including random effects
for( i in 1:I )
{
u[i,1] ~ dnorm(0,tau.u.int)
u[i,2] ~ dnorm(0,tau.u.slopes)
}

# Random effects for each item
for( k in 1:K )
{
w[k] ~ dnorm(0,tau.w)
}

# Define model for each observational unit
for( j in 1:N )
{
mu[j] <- ( beta[1] + u[subj[j],1] ) +
( beta[2] + u[subj[j],2] ) * ( so[j] ) + w[item[j]]
rrt[j] ~ dnorm( mu[j], tau.e )
}

#------------------------------------------------------------
# Priors:

# Fixed intercept and slope (uninformative)
beta[1] ~ dnorm(0.0,1.0E-5)
beta[2] ~ dnorm(0.0,1.0E-5)

# Residual variance
tau.e <- pow(sigma.e,-2)
sigma.e ~ dunif(0,100)

# Between-subj variation
tau.u.int <- pow(sigma.u.int,-2)
sigma.u.int ~ dunif(0,10)
tau.u.slopes <- pow(sigma.u.slopes,-2)
sigma.u.slopes ~ dunif(0,10)

# Between-item variation
tau.w <- pow(sigma.w,-2)
sigma.w ~ dunif(0,10)
}",
file="JAGSmodels/gwintslopeuninfv2.jag" )