As Stata is telling you, -substr()- is not
a command.
It is a function. Functions cannot be invoked
in this way. The manual section you cite
does not show a command prompt.
You can use -substr()- to remove parentheses, but
as I advised earlier, -destring- is probably
easier for you.
destring v1, ignore("()") replace
Nick
[email protected]
b. water
> Stata 8.2 Window XP Pro SP2.
>
> Thanks to Richard Goldstein & Nick Cox for their advice.
> Split and parse
> with destring works well and overcome my defective substr
> (see below). Here
> are my substr tries (v1 is my data authors (year) variable following
> insheet) and the accompanying error messages:
>
> . substr(v1,-6,.)
> unrecognized command: substr
> r(199);
>
> . substr("v1",-6,.)
> unrecognized command: substr
> r(199);
>
> . substr("abcdef",2,3)
> unrecognized command: substr
> r(199);
>
> Any explanation for the error messages? The last example was
> taken straight
> from the manual [R] functions substr(s,n1,n2).
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/