Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

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

From   Sergiy Radyakin <>
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–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index