Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: list in stata8

From   "Nick Winter" <>
To   <>
Subject   RE: st: RE: list in stata8
Date   Tue, 25 Feb 2003 12:14:42 -0500

> -----Original Message-----
> [] 
> Sent: Tuesday, February 25, 2003 12:05 PM
> To: ''
> Subject: RE: st: RE: list in stata8
> Nick - I often just type "list in 101/123" or some such other 
> numbers with
> limited range - even though I may have 50000 observations. I 
> find this less
> bothersome than going to the editor and searching for 
> observations 101/123.
> Will list8 also be slow if you give it a limited range even 
> though there are
> 10000's of observations?
> Al Feiveson

I just tried this out, and the delay before the list begins seems to be
related to the number of observations to be listed.  Thus,

	. list in 50000/50010

takes 0.01 seconds in my test database, whereas

	. list

takes over 4 seconds to begin.

The following takes about 0.17 seconds:

	. list if inrange(_n,20000,20035)

campared with:

	. generage rand=uniform()
	. list if rand>.9999	

which takes about 0.18 seconds to list in my sample dataset, and
produces 35 observations.  So there appears to be no penalty (beyond
that associated with -if-) for non-contiguous observations...the delay
in listing is purely a function of the number of observations to be
listed.  This makes sense, given the cause of the delay, as explained
earlier on this thread.

Nick Winter

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index