Statalist


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

Re: st: handling missing values


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: handling missing values
Date   Mon, 02 Mar 2009 15:37:38 -0500

I would normally create a new response category for question 2,
NA (not applicable), which is true if question 1 does not equal "yes".
You don't say how your variables are encoded (as strings or numbers -
numbers are better but that's a different question); if as strings
then

   replace q2 = "NA"  if q1!="yes"


hth,
Jeph


Jillian Flight wrote:
> Hi there,
> I am working on a survey data recode and wanted to see if there is an easy
> way to handle missing values.   For instance, if question 1 asks whether or
> not respondent used cocaine in lifetime - and the responses are yes, no,
> don't know and refused.  Question 2 (have you used in past 12 months -
> response choices yes, no, dk, ref )  however is asked only of those who
> said yes to question 1 - the no, dk, and refused responses from Question 1
> are missing - - is there a quick and easy way to recode question 2 so that
> it is among the total population - ie. the missing values that are a result
> of respondents saying "no" to question 1 being coded into the "no" of
> question 2 and the dk and refused choices from question 1 which are now
> missing in question 2 - having them coded into the dk and refused of
> question 2?  I am currently doing this via a very convaluded method and a
> colleague told me spss is much easier for handling missing values when
> recoding data such as this, but I'm thinking there must be an easy way of
> doing this in stata.
> 
> Thanks
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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