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]

Re: st: Store Results of a List?

From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Store Results of a List?
Date   Tue, 30 Aug 2011 15:32:37 +0100

Strictly, -list- does not have results; it just displays data (and
sometimes other stuff too).

You can do this, or more precisely an equivalent,  but it sounds like
a bad idea, as if you have an idea on how to do something and imagine
that this is the first or needed step. It's not something that sounds
very natural in Stata.

You could always use Mata to get a vector with just these values.

I suggest you explain the underlying aim.


P.S. The term "local variable" is a solecism in Stata. See

P.P.S. The list is not called Statlist!

On Tue, Aug 30, 2011 at 3:20 PM, Jacob Robbins <[email protected]> wrote:
> Dear Statlisters,
> I am trying to think of a way to store the results of a list command
> in a matrix or a local variable. For example,
> list hospid if var1>=50 & var2==100
> 50
> 47
> 25
> I want to store the results in a local variable; local test "50 47 25".
> Does anyone know a way to do this?
*   For searches and help try:

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