title: How to represent a categorical predictor rstan?
body: <p>What is the proper way to format a categorical predictor to use in STAN? I cannot seem to input a categorical predictor as a normal factor variable, so what is the quickest way to transform a normal categorical variable such that Stan can accept it?</p>
  <p>For example, say I had a a continue predictor and a categorical predictor</p>
  <pre><code>your_dataset = data.frame(income = c(62085.59, 60806.33, 60527.27, 67112.64, 57675.92, 58128.44, 60822.47, 55805.80, 63982.99, 64555.45),
  country = c(&quot;England&quot;, &quot;England&quot;, &quot;England&quot;, &quot;USA&quot;, &quot;USA&quot;, &quot;USA&quot;, &quot;South Africa&quot;, &quot;South Africa&quot;, &quot;South Africa&quot;, &quot;Belgium&quot;))
  </code></pre>
  <p>Which looks like this:</p>
  <pre><code>     income      country
  1  62085.59      England
  2  60806.33      England
  3  60527.27      England
  4  67112.64          USA
  5  57675.92          USA
  6  58128.44          USA
  7  60822.47 South Africa
  8  55805.80 South Africa
  9  63982.99 South Africa
  10 64555.45      Belgium
  </code></pre>
  <p>How would I prepare this to be entered in <code>rstan</code>?</p>