Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: missing values


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: missing values
Date   Thu, 22 Sep 2005 06:11:50 -0500

At 01:11 AM 9/22/2005, you wrote:
Here are my exact commands.

replace sswlnw_1 = .a if (yob > 1912 & a_age > 69)
replace sswlol_1 = .a if (yob > 1912 & a_age > 69)
replace sswlnw_2 = .a if (yob > 1912 & a_age > 69)
replace sswlol_2 = .a if (yob > 1912 & a_age > 69)

If I use . instead of .a, 0 changes are made. (With .a, 57981 changes re made)

If I say gen dummy = 0
replace dummy = 1 if (yob > 1912 & a_age > 69)
then 57891 changes are made...
Incidentally, here is a pseudo-cloning of what you are doing (I think):

. sysuse auto, clear
(1978 Automobile Data)

. gen dummy = 0

. replace dummy = 1 if (mpg > 20 & trunk > 15)
(6 real changes made)

. replace price = . if (mpg > 20 & trunk > 15)
(6 real changes made, 6 to missing)

. sysuse auto, clear
(1978 Automobile Data)

. replace price = .a if (mpg > 20 & trunk > 15)
(6 real changes made, 6 to missing)

As you see, it seems to work fine, regardless of whether I use . or .a.

One other Q: What version of Stata are you using? Is it up to date? I remember there was some problem with Stata a while back where it was behaving in odd ways with MD, but then an update fixed it. I don't know if that might apply here or not.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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/




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