Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Dealing with missing values

From   Ching Wong <>
Subject   st: Dealing with missing values
Date   Tue, 2 Apr 2013 09:28:40 +1030


I am currently using Stata 12.

I need to convert the variable 'year' to a numeric variable by using
the commands, gen yr = date(year, "Y"). However, there is 1 missing
value generated. I have no idea why it would happen. As I have checked
every single obs for 'year', there is no missing value. But when I
checked the obs for 'yr', there is one "." after converting from
'year' to 'yr'.

Why does it happen only for the year 1990 particularly, which is the
maximum for the variable 'year'? And how should I deal with this
missing value? I have tried to replace yr="" if yr==".". But it can't
be eliminated. ie type mismatch r(109)

Year  Yr
1960   0
1940   -7305
1990   . <--??
1986   9497
1915   -16436

Thank you for your time.

Best regards,

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index