Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Importing String Variables ruins access to variable categories


From   Sara LaPlante
To   [email protected]
Subject   st: Importing String Variables ruins access to variable categories
Date   Thu, 15 Sep 2011 11:09:13 -0400

Hi,

I am trying to import data into Stata 11 from a Mac.  I have access to a PC, but it only has Stata 8.  I emailed myself the data file as a .csv and was able to open the data with one problem- something is wrong with all my string variables.  For example, when I try to find out what the gender distribution is only for people from England, I type in the following and get the following error message:

table male if nation==england
yemen not found
r(111);

However, this command works fine for any numerical data.  In the example above, England is not just a label.  That is, nation is not coded as japan=1, england=2, etc.  Because I can type in the following command and get the same error message:

table male if nation==england
type mismatch
r(109);

Is there a way to fix this on my Excel file?  I would like to avoid manually recoding all my string variables into numerical values.  Any help would be appreciated!
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index