title: STAN IRT via R programming, issue with parameter declaration?
body: <p>I'm following along with this official IRT w/ STAN <a href="https://mc-stan.org/docs/2_20/stan-users-guide/item-response-models-section.html" rel="nofollow noreferrer">tutorial</a>. The details of the model are copied below:</p>
  <pre><code>data {
    int&lt;lower=1&gt; J;              // number of students
    int&lt;lower=1&gt; K;              // number of questions
    int&lt;lower=1&gt; N;              // number of observations
    int&lt;lower=1,upper=J&gt; jj[N];  // student for observation n
    int&lt;lower=1,upper=K&gt; kk[N];  // question for observation n
    int&lt;lower=0,upper=1&gt; y[N];   // correctness for observation n
  }
  
  parameters {
    real delta;         // mean student ability
    real alpha[J];      // ability of student j - mean ability
    real beta[K];       // difficulty of question k
  }
  
  model {
    alpha ~ std_normal();         // informative true prior
    beta ~ std_normal();          // informative true prior
    delta ~ normal(0.75, 1);      // informative true prior
    for (n in 1:N)
      y[n] ~ bernoulli_logit(alpha[jj[n]] - beta[kk[n]] + delta);
  }
  
  </code></pre>
  <p>I'm not certain which variables do and do not need to be declared in R code.</p>
  <pre><code>toy_data &lt;- list(
    J= 5,
    K = 4,
    N =20,
    y= c(1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0)
                  )
  fit &lt;- stan(file = '1PL_stan.stan', data = toy_data)
  </code></pre>
  <p>However, the following error is triggered.</p>
  <pre><code>Error in mod$fit_ptr() : 
    Exception: variable does not exist; processing stage=data initialization; variable name=jj; base type=int  (in 'model920c4330dff_1PL_stan' at line 5)
  
  In addition: Warning messages:
  1: In readLines(file, warn = TRUE) :
    incomplete final line found on 'C:\Users\jacob.moore\Downloads\1PL_stan.stan'
  2: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
    '-E' not found
  failed to create the sampler; sampling not done
  </code></pre>
  <p>In my past work, I've used python almost exclusively. So learning R has been quite the learning curve; additionally, I'm very new to STAN, hence the toy example.</p>
  <p>The core idea is that there are 20 child/question pairings. 5 children and 4 different questions. I'm uncertain why my code is triggering the error, and what I should do to correct it. Can you clarify what needs adjustment for this code to run without triggering an error?</p>