> The function grp2idx doesn't seem to exist anywhere obvious ... Is
> that the problem or is it something I typed in?
The error is most likely due to the problem of statistics toolbox in Matlab. Type
which grp2idx
inside Matlab. If it does not know it, you don't have the statistics toolbox for the 2007b version, and you have to pay Mathworks some extra money to update the toolbox. Or you can try the old version if it's still available on your machine.
Another option is to use 3dLME.R
Gang