Bookmark and Share

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 <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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
njcoxstata@gmail.com


On 17 October 2013 13:18, Evan Lee <evanlee201305@gmail.com> 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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index