Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: still having problems with converting string variables

From   Suzy <[email protected]>
To   [email protected]
Subject   st: still having problems with converting string variables
Date   Sun, 17 Oct 2004 12:26:48 -0400

Dear Statalisters,

I have a number of string variables in my dataset. Within these string variables are observations that are coded with either numeric categorical values coded like this: (4010, 40120) or with dashes (4010-, 4012-) meaning that these four codes represent four different things. Each string variable has hundreds of different categories that are coded in this manner. I'm trying to convert the string variables to numeric and also be able to retain analysing the observations that the contain dashes.

I've tried various destringing options such as these listed below with the following STATA response.:

.destring dxcode1, generate(dxcode1num)
dxcode1 contains non-numeric characters; no generate

.destring dxcode1, replace
dxcode1 contains non-numeric characters; no replace

I've e-mailed once before on this topic, so I apologize in advance for the redundant question, but I'm still having trouble and I'm not computer/STATA savvy. If anyone has some beginner user-friendly advice with explicit coding, it would be much appreciated.

Thank you in advance,

* For searches and help try:

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