Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Dealing with missing values
From
Ching Wong <[email protected]>
To
[email protected]
Subject
st: Dealing with missing values
Date
Tue, 2 Apr 2013 09:28:40 +1030
Hi,
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,
Wong
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/