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: Problem with Stata handling of large dataset


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: Problem with Stata handling of large dataset
Date   Mon, 5 Aug 2013 14:08:05 -0500

Stata defaults to a float data type which has 7 digit of precision.
See -help data_types-

Yes.  Or use the -bysort- prefix which just means that -by- sorts the
data first.

Scott




On Mon, Aug 5, 2013 at 1:46 PM, Palan, Stefan
([email protected]) <[email protected]> wrote:
> 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/

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