[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: destringing
On Aug 28, 2004, at 2:33 AM, Suzy wrote:
Such variables do not exist in Stata. If a variable contains string
contents, it is string. There is nothing wrong with the string "1234".
But unlike Excel, where columns may contain both data types, Stata
variables are one or the other. If you want to preserve contents which
are part alpha string and part numeric string, you must use string
variables to store them. encode (or Roger Newson's sencode) is the
answer, and will preserve and display the existing contents while
allowing the variables to be used numerically. For example see the
variable foreign in auto.dta: one could say that it was the string
"domestic" or 'foreign" but was encoded (and made into a dummy).
I don't know if this matters but I'm not starting with purely string
variables. I have variables that have datapoints of which some are
string and some are numeric.
* For searches and help try: