Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Not enough memory message after -keep in 1-

From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   st: Not enough memory message after -keep in 1-
Date   Fri, 12 Aug 2011 18:50:38 -0400

Dear All, Stata shows some rather inefficient behavior in the following code:

set mem 1g
set obs 52428770
gen double x=uniform()
keep in 1

(11MP/32bit and earlier 32-bit versions, not tested with Stata 12).

Seems that Stata is requiring memory for an additional variable (I
suspect "touse")
to keep the first observation, which in this case is causing a "not
enough memory"

I was under impression that "in A/B" is present in the Stata's syntax
precisely for
efficiency reasons, but from above it follows that it is fully equivalent to
if inrange(_n, A,B).

Is this correct or how is "in" different?

Thank you, Sergiy
*   For searches and help try:

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