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   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Problem with Stata handling of large dataset
Date   Mon, 5 Aug 2013 20:03:46 +0100

The default default [repetition intended] variable type for -generate-
is -float-, which is often inadequate for identifiers, so yes, you
often need to be proactive about variable type.

Prior sorting is needed in the second example.
Nick
[email protected]


On 5 August 2013 19:46, 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