Now we need the model file for WINBUGS and we can run the regression.
You can screen scape the model below or simply download it here:
h105_BUGS_model_example.txt
model
{
#
# X[,1] = DW-NOMINATE 1st Dimension
# X[,2] = DW-NOMINATE 2nd Dimension
# X[,3] = 1 if Republican, 0 otherwise
# X[,4] = 1 if South (CQ def.), 0 otherwise
#
# PRIORS
#
tau ~ dgamma(1.0E-1, 1.0E-1)
for (k in 1 : 3) { beta[k] ~ dnorm(0,0.001)} # vague priors
#
# LIKELIHOOD
#
for (i in 1 : 434) # loop over congressional districts
{
#
X[i,1] ~ dnorm( mu[i] , tau)
mu[i] <- beta[1]+X[i,3]*beta[2]+X[i,2]*beta[3]
}
sigma <- sqrt(1/tau)
#
}