Joy,
You can also use the command -destring- to convert string variables
to numeric variables. The encode entry in the Stata Reference Manual
states: "Do not use encode if varname contains numbers that merely
happen to be stored as strings; instead use generate
newvar=real(varname) or destring."
Friedrich Huebler
--- Joy Chen <[email protected]> wrote:
> I wonder if anyone knows to how to solve this problem. I have a
> .txt data
> and I used -insheet using data1.txt, t- to import it into stata. It
> shows
> that the display type of the variables are string variable. I tried
> to
> convert them into numerical vars. I replaced #.# in -format-
> command with
> #,# as it is European decimal symbol (the comma) used in data.
> After many
> trials, it still gives me strange result. The mean, max and min of
> the
> variables are far away from the truth. For example, the mean for
> e1 should
> be -0,27145726 but stata gives 1,64654, for f1 the true mean is
> 0,49880390,
> in stata is 2,299758 .
>
> Did I make some mistake in the code? Can anyone give me a hand?
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/