Continue with this, I run a model for an ordinal variable as in the following codes:
data {
int<lower=1> N; // Sample size
int<lower=1> Nsubj; // Number of subjects
int<lower=2> Ncate; // Number of categories
int<lower=1, upper=Nsubj> ID[N]; // Subject ID
int<lower=0> Nobsadl;
int<lower=0> Nmisadl;
int adlobs[Nobsadl];
real age[N];
// Predictor: Age
int indadl[N];
}
parameters {
vector[1] beta; // Regression parameters
ordered[Ncate-1] cutpoints;
vector[Nsubj] b0; // Random intercepts
real<lower=0> sigmab; // RI SD
int adlmis[Nmisadl];
}
model {
vector[N] adl;
adl[indadl] = append_row(adlobs, adlmis);
// Prior distributions
b0 ~ normal(0, sigmab); // Subject random effects
// sigmab ~ uniform(0, 10); // Prior for sigma RI
for (i in 1:1){