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, statalist.org is already up and running.


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

Re: st: Figuring out if variables that were read in are strings or not


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Figuring out if variables that were read in are strings or not
Date   Wed, 28 Dec 2011 14:12:31 +0100

On Tue, Dec 27, 2011 at 7:35 PM, Debs Majumdar wrote:
>    Is there a way to find out if any of the variables are read in as string?
>
> I am using the --insheet-- command to read in a text file with around 20K variables which might contain "NA" in which case they would be read in as string.

You can get a list of all string variables in your dataset with -ds,
has(type string)-. If you want to check whether a specific variable
(say x) is a string you can use -confirm string variable x-.

Hope this helps,
Maarten


--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index