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]

st: Problem with Stata handling of large dataset


From   "Palan, Stefan ([email protected])" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Problem with Stata handling of large dataset
Date   Mon, 5 Aug 2013 20:46:53 +0200

Hi Scott,

Okay, sorry, that was stupid. Let me describe two different problems I encountered. When I type the following...

clear
set obs 20000000
gen id=_n
tsset id

...I get an error, since the values of id are not unique. This seems to be an issue having to do with the data type Stata uses for id. If I explicitly define id as type "long", the problem goes away. So I guess I should not rely on Stata to choose the appropriate variable type?

Another point I noticed when testing things. When I type...

clear
set obs 2
gen x=_n
by x: gen y=_n

...I get an error message that the values in x are not sorted. Do I have to explicitly sort by x prior to running the last command, even if the values in x are already in the correct order?

Stefan.


*
*   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