title: Node inconsistent with parents in JAGS model (R)
body: <p>I'm new to JAGS, and I'm trying to run a simple logistic regression. My data file is very simple: the response is binary and the one predictor I'm using has three levels. Like this:</p>
  
  <pre><code>col1: 1 2 2 2 1 1 1 2 1 2 ... 
  col2: HLL, HLL, LHL, LLL, LHL, HLL ...
  </code></pre>
  
  <h2>Dummy coding</h2>
  
  <p>The levels in <code>col2</code> are <code>HLL, LHL, LLL</code>. I dummy coded it and created a data frame that looks like this:</p>
  
  <pre><code>(intercept) HLL LHL LLL
  1           1   0   0   1
  2           1   0   0   1
  4           1   0   0   1
  5           1   0   1   0
  6           1   0   1   0
  7           1   0   0   1
  </code></pre>
  
  <h2>Data list</h2>
  
  <p>My data file (<code>myList</code>), then, looks like this:</p>
  
  <pre><code>List of 5
  $ y  : num [1:107881] 2 2 2 2 2 2 2 2 2 2 ...
  $ N  : num 500
  $ HLL: num [1:107881] 0 0 0 0 0 0 0 0 0 0 ...
  $ LHL: num [1:107881] 0 0 0 1 1 0 0 0 0 1 ...
  $ LLL: num [1:107881] 1 1 1 0 0 1 1 1 1 0 ...
  </code></pre>
  
  <p>I'm using <code>N=500</code> because the full data frame is huge and I just want to test it. </p>
  
  <h2>Model</h2>
  
  <pre><code>cat(
  
      "model {
          for( i in 1 : N ){
  
              y[i] ~ dbern(mu[i])
              mu[i] &lt;- 1/(1+exp(-(a + b*HLL[i] + c*LHL[i] + d*LLL[i])))
              }
  
              a ~ dnorm(0, 1.0e-12)
              b ~ dnorm(0, 1.0e-12)
              c ~ dnorm(0, 1.0e-12)
              d ~ dnorm(0, 1.0e-12)
  
              }", file = "model.txt"
  
  )
  </code></pre>
  
  <h2>Running model + error</h2>
  
  <pre><code>model = jags.model(file = "model.txt", 
      data = myList,
      n.chains = 3, n.adapt = 500)
  </code></pre>
  
  <h3>Error I get</h3>
  
  <pre><code>Error in jags.model(file = "model.txt", data = antPenList, n.chains = 3,  : 
  Error in node y[1]
  Node inconsistent with parents
  </code></pre>