Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Recoding missing variables


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: Recoding missing variables
Date   Sun, 16 Jul 2006 10:44:23 -0400

At 11:23 PM 7/15/2006, Ashwin wrote:
Thanks for the reply. I do not want to drop the entire
observation as it has nonmissing values for some other
variables. For examples,


        var1     outcome1 var3   var4
obs1     1         2       7     99
obs2     99        99      3      1
obs3      0         2       5     4
obs4      1         0       99    99


For analyses of var1 , i want to include obs1, 3, 4
and for var 3 - obs 1,2, and 3.

However, when i run the regression for outcome1
against var1, var3 or var4, I do not want the "99" to
be included as a legitimate coding for those variables
and hence influence the odds ratio estimate.

Hope that clarifies my question a bit.
[...]
Just recode 99 to missing, as some other people have advised you to do. (You can use -mvdecode- or -recode- or -replace-.)

Then, in any regression, only those observations with missing values in any of the variables used in that regression are omitted.

Then, for example, in
regress outcome1 var1
observation 2 will be omitted, and in
regress outcome1 var3
observations 2 and 4 will be omitted.

This is probably what you had in mind, but this has the slight "problem" that as you tweak your covariate set, the observation set may change as well.

I hope this helps.
--David

*
* 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