Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: how to name a column with decimals
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: how to name a column with decimals
Date
Thu, 17 Oct 2013 13:31:28 +0100
That's correct. Decimal points are not allowed in variable names.
Period. You could use an underscore _.
By the way, what you are doing sounds fairly strange. Why do you think
you need to do that?
(Also the -bysort- is immaterial to the rest of your calculation.)
Nick
[email protected]
On 17 October 2013 13:18, Evan Lee <[email protected]> wrote:
> Dear listers,
>
> This might be a simple question, but I could not figure that out. I am
> doing a loop: forvalues i = 1000(0.1)2000 {
> bysort date: gen `i' = ln(i/closeprice)
> }
>
> As there will be 1001 new columns created, I would like each column to
> be named using i. However, seems like stata does not allow decimal
> places in the variable names and it came up with an error msg of
> "invalid name".
>
> Has anyone got a clue on this? Thanks in advance for your help.
>
> Evan
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/