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: generate variable versus define scalar, with conditional statement


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: generate variable versus define scalar, with conditional statement
Date   Tue, 15 Jan 2013 15:33:24 +0100

On Tue, Jan 15, 2013 at 3:25 PM, annoporci  wrote:
> yes, I see, absolutely, I did try this also:
>
> scalar newscalar = open[3jan2012]
>
> but it didn't work, even after a tsset date, and there must be a logical
> explanation
> for that too, naturally, but I guess I ran out of ideas and stopped
> thinking.

If you type in Stata -varname[<something>]- than <something> is an
observation number. So 1 for the first observation, 2 for the second,
etc. So <something> can never be string.

-- Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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