[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: macro for the type of a variable (string/numeric)

From   "Austin Nichols" <>
Subject   Re: st: macro for the type of a variable (string/numeric)
Date   Mon, 21 Apr 2008 11:19:46 -0400

See the second entry under
help extended_fcn

or try:
sysuse auto
foreach v of varlist _all {
 loc type: type `v'
 di as res "`v'" as txt " is type" as res " `type'"

On Mon, Apr 21, 2008 at 11:01 AM, Jacob Wegelin <> wrote:
> The following program is a kluge to determine the type of a variable and to
> assign a string to a local macro which tells us the type.  Is there some
> better way? For instance, "return list" after "describe myvar" or "codebook
> myvar" does not tell us this.
*   For searches and help try:

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