Hi all,
I’m receiving the following error when running the code pasted below
Error in prep_call_sampler(object) : could not find function “prep_call_sampler”
I tried some of the suggestions indicated in a post in June 2019 and it didn’t work. I am running on a Mac with Catalina recently installed. I am using RStudio version 1.3.1073 and rstan version 2.21.2. The code is here
modelString = "
data {
int<lower=1> n; // number of students
int<lower=1> G; // number of schools
int schid[n]; // school indices
vector[n] ASRREA01; // reading outcome variable
vector[n] ASBG04;
vector[n] ACBG03A;
}
parameters {
vector[G] alpha;
vector[G] beta1;
real gamma00;
real gamma01;
real mu_beta1;
real<lower=0> sigma_alpha;
real<lower=0> sigma_beta1;
real<lower=0> sigma_read;
}
model{
gamma00 ~ normal(300,100);
gamma01 ~ normal(0, 5);
mu_beta1 ~ normal(0, 5);
sigma_read ~ cauchy(1,5);
sigma_alpha ~ cauchy(1,5);
sigma_beta1 ~ cauchy(1,5);
for(g in 1:G) {
alpha[g] ~ normal(gamma00 + gamma01 * ACBG03A[g], sigma_alpha);
beta1[g] ~ normal(mu_beta1, sigma_beta1);
}
for(i in 1:n) {
ASRREA01[i] ~ normal(alpha[schid[i]] + beta1[schid[i]] * ASBG04[i], sigma_read);
}
}
"