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

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: AW: RE: encode question |

Date |
Fri, 13 Feb 2009 14:37:50 -0000 |

mistakenly were read in as string." Thanks. Nick n.j.cox@durham.ac.uk Martin Weiss " The question is evidently about string variables that mistakenly were read in as numeric." Arina`s initial question sounded more like numeric vars being read in as strings. Nick Cox The question is evidently about string variables that mistakenly were read in as numeric. Thus -destring-, not -encode-, is the answer. Also, as Austin's suggestion makes plain, you don't need to code for a loop over variables or the overwriting of existing variables, as -destring- will do that for you. Arina's problem is already written up as two FAQs: FAQ How can I quickly convert many string variables to numeric variables? . . . . . . . . . . . . . . . . . . UCLA Academic Technology Services 7/08 <http://www.ats.ucla.edu/stat/stata/faq/destring.htm> FAQ . . . . . . . . . . . . . . . . . . Numeric variables input as string 2/02 Stata is reading in my variables as string, whereas they should be numeric. What should I do? <http://www.stata.com/support/faqs/data/allstring.html> If you wished to -encode- several variables simultaneously -- and _also_ wanted the same set of value labels -- that is handled by -multencode- on SSC, as discussed on this list last month. Nick n.j.cox@durham.ac.uk Austin Nichols destring _all, replace Arina Viseth I have a dataset that I imported from Excel using insheet. However, many numerical variables (I have about 200 variables) are now showed as string variables. My question is the following: how can I transform each string variable into numerical one - and also replicate their names - without having to encode manually each one of them? * * 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/

**References**:**st: encode question***From:*Arina Viseth <arina@UDel.Edu>

**st: RE: encode question***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**st: AW: RE: encode question***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: event history analysis with years clustered in individuals** - Next by Date:
**Re: st: how to remove axis margin from plot** - Previous by thread:
**st: AW: RE: encode question** - Next by thread:
**st: a graph named "new"** - Index(es):

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