Error in ulam in R

I created this model

Ass14.ulam<-ulam(
    alist(
        Th14z ~ dnorm( mu , sigma ) ,
        mu <- a[cond]+b[cond]*(Age-27.7219),
        a[cond]~ dnorm( 0, 0.1) ,
        b[cond]~dnorm(0,0.05),
        sigma ~ dexp( 1 )
    ) , data=dat_list, chains=4, cores=5 )

I have this error message

Error in stanc(file = file, model_code = model_code, model_name = model_name, :
0
Syntax error in ‘string’, line 4, column 13 to column 16, parsing error:
-------------------------------------------------
2: vector[274] Th14z;
3: vector[274] Age;
4: int cond[274];
^
5: }
6: parameters{
-------------------------------------------------

“;” expected after variable declaration.
It looks like you are trying to use the old array syntax.
Please use the new syntax:
array[274] int cond;

Could you help me to resolve this error message

If ulam is using the old syntax, could you be using an old version of rethinking? Have you tried reinstalling it?

Just a heads up. ulam isn’t a Stan project, it’s from @richard_mcelreath. It does use Stan under the hood. I was going to suggest asking Richard directly on the software’s site,

but it doesn’t look like anyone’s dealing with the issues as there are over 200 of them!

The array syntax was fixed more than a year ago. So definitely an old install.

(Also why does this forum exist? Just so Bob can post passive aggressive messages?)

@Bob_Carpenter Wait until you see how many there are for RStan ;)

@richard_mcelreath I don’t think the message was intended that way, but I can see how it comes across like that. Sorry! Big fans of rethinking here!

I’m sorry, @richard_mcelreath. I can now see how it could be taken as a criticism of you for not responding to issues on your package, but I really didn’t intend it that way. I don’t think we owe anything to users as open-source devs—it’s all just volunteer work. And I really don’t want to piss off anyone, much less people like you who have been so valuable to the project and to statistics. I’m constantly recommending your book to people who ask how to learn Bayesian stats, and I hope to be able to recommend the workflow book soon.

I hope people find most of what I’m contributing here constructive. I certainly intend everything that way. Having said that, this isn’t the first time I’ve been called out for offending other forum members. Maybe I should take another break, because I really don’t want to turn into the cranky forum admin.

Going back to ulam, is there a better person to ping or a better venue in which to ask questions about it? If so, I can send people there.

1 Like

I definitely think most of what you contribute is constructive and I don’t think you should take another break (unless you want to, of course). I think the value you provide here far far outweighs the cost of any accidental cranky forum admin moments ;)

Same!