Yazhen,
When you look closely you can see that the left and right quotes are
different.
observation`i' (correct)
observation'i' (incorrect)
Friedrich
--- Yazhen Gong <[email protected]> wrote:
> Hi Joseph,
>
> I tried to replicate the program that you have written
> as an excercise, but I had a problem. I tried to
> replicate:
>
> forvalues i=1/2{
> generate str observation'i'="An observation"
> }
>
> When I typed the closed bracket } ,Stata returned me
> with an error message showing "invalid name". But
> when I copied the same three lines from your email,
> there was no error message. I cannot figure out the
> reason. Would you please to give me a hint?
>
> Thanks!
>
> Yazhen
> --- Joseph Coveney <[email protected]> wrote:
> [snip]
> > forvalues i = 1/2 {
> > generate str observation`i' = "An observation"
> > }
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
*
* 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/