Statalist The Stata Listserver


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

Re: st: using information in value labels


From   "Alexander Nervedi" <alexnerdy@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: using information in value labels
Date   Tue, 13 Feb 2007 03:05:34 +0000

Thank you Quang.

I didn't know that command and it is helpful. It is quite an improvement on physically recoding each variable. However, it requires me to scan about a thousand variables and for each variable know what the missing codes are.

Admittedly most of them are 9/99/998 ..... but some may not be. And i wouldn't be sure if it had worked without linear scan of the entire data set.



From: "Quang Nguyen" <quangn@gmail.com>
Reply-To: statalist@hsphsun2.harvard.edu
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: using information in value labels
Date: Mon, 12 Feb 2007 17:00:28 -1000

Dear Alex,

Can you have a look at the _mvencode_ command? Also, you may fin dthe
following helpful:
http://www.ats.ucla.edu/stat/stata/faq/missing_mvencode.htm

Have A Great Day!

On 2/12/07, Alexander Nervedi <alexnerdy@hotmail.com> wrote:
Hi

I have a complex survey dataset which has been helpfully cleaned - each
variable has its missing values coded with 9/99/999/999 or 98/998/9998 etc.
and things like Missing, Did not respond, refused to answer etc. are all
coded in as value labels.

I would like to treat all of these as missing and want to run a loop as
follow

local allvars x1 ... x100

foreach var of local allvars{

label list `var'
*pseudo code follows
scan label to see which levels include - "Missing", "missing", "did not
respond", etc
for each level `i' {
recode `var' (`i' = .)
}

}


I was wondering if this is something that could be reasonably be
implemented.

Saludos!
Alex

_________________________________________________________________
Laugh, share and connect with Windows Live Messenger
http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=hmtagline

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

*
*   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/
_________________________________________________________________
Search for grocery stores. Find gratitude. Turn a simple search into something more. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index