[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 <>
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.


On Nov 25, 2008, 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, 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
*   For searches and help try:

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