title: how do to Xb calculation in R2OpenBUGS, when p is not known
body: <p>I want to calculate x1b1+x2b2+......+xpbp. However, p is not known, I cannot write it down in advance. So I want to do the following. But in BUGS it says multiple definitions error.</p>
  
  <pre><code>  betax &lt;- 0
    for(k in 1:p){
      betax &lt;- betax + beta[k]*x[i,k]
    }
  </code></pre>
  
  <p>Is there any ways to get it done in bugs model?</p>