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: From: Richard Moverare <[email protected]>
From
[email protected]
To
statalist <[email protected]>
Subject
st: From: Richard Moverare <[email protected]>
Date
Sun, 16 Jun 2013 20:16:13 +0200
Dear Statalist,
I have a small problem that I guess I should be able to solve, but I
got stuck. I have a string variable that consists of 1-3 numbers,
space, and then a description. The description varies in terms of
numer of words and characters.
What I would like to do is to create a numeric variable where the
values are the numbers in the beginning of the string and then use the
rest of the string as a value label. The dataset includes a number of
duplicates for this specific variable (one of the reason for doing
this conversion is to make the dataset smaller in size). The first
part is no problem using -word-, and I can get what I want as a label
by getting the second word and those that follow, but I got stuck
defining the labels for the variable.
The variables looks something like this:
234 Used cars, no batteries
22 Bottles - unspecifed
234 Used cars, no batteries
440 N/A
and so on.
Any help would be greatly appreciated!
All the best, Rick
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/