Statalist


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

Re: st: STATA cannot read a vlue of dataXY=.z_


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: STATA cannot read a vlue of dataXY=.z_
Date   Wed, 26 Nov 2008 09:18:48 -0500

Pascal, I should have noted that ".z" is a legal Stata missing value. The problem is the underscore "_".

I recommend that you read the variable as a string, as I suggested, then remove the "_" and convert to numeric with -destring- : destring dataXY, ignore("_") replace

Then label the missing value:

label define rec_err  .z "Recording Error"
label values dataXY  rec_err

-destring- and -label values- both can operate on a list of variables, so you can fix other variables with the ".z_" value at the same time.

-Steve

On Nov 25, 2008, [email protected] wrote:

Read the variable in as string, convert the ".z_" to whatever missing value code you wish (not zero!); "gen newvar =real (oldvar)" to convert to numeric; and drop the original version.

On Nov 25, 2008, at 1:29 PM, [email protected] wrote:

STATA cannot read a vlue of dataXY=.z_

STATA cannot read some entries in a numeric variable with the value
.z_, which are recording errors in Compustat. Trying to convert them
to 0 was not possible as STATA somehow does not recognize these
entries.
*
*   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/



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