The error message here is tricky because variables
get used in contexts that could also be a function
name or number or bracket.
model {
STATEMENT
...
}
where STATEMENT can be
a_1 ~ foo();
4.2 ~ foo();
(a + b) ~ foo();
{ a ~ foo(); }
So we cna have any of a variable (a_1), a numeric literal (4.2),
a complex expression ((a + b)), or a block ({ ... }). It can
also be just a close curly brace ('}') to end the block.
If I've seen an open brace ('{'), then I have to get a
statement of some kind or a close brace -- I doubt the error
message is that clear, nor do I know offhand how to make it
that clear (I'll think about it some more).
- Bob
On 8/10/12 9:00 AM, Andrew Gelman wrote: