Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Antonio Rodriguez Andres" <Antonio.Andres@emu.edu.tr> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: Grouping income variables- RECODE COMMAND |
Date | Sat, 1 Feb 2014 20:19:26 +0200 |
Nick The ESS defines the income categories as follows J- Less than 40 Euros R- 40 to under 70 C- 70 under 120 . . . U-1730 to under 2310 N-2310 or more Hope this clarifies your question Regards Antonio -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox Sent: Saturday, February 01, 2014 7:52 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: Grouping income variables- RECODE COMMAND Your code shows you using the -recode()- function, which is quite different from the -recode- command. In Stata functions and commands are different! I think that to comment helpfully we need to see more about your -hinctnt-, for example, the results of . su hinctnt, detail Your categories are not disjoint as (e.g.) the definitions [70, 120] and [120, 230] leave ambiguous what happens with 120. Alternatively, your notation here confuses the meaning of [ ] and ( ). Nick njcoxstata@gmail.com On 1 February 2014 17:29, Antonio Rodriguez Andres <Antonio.Andres@emu.edu.tr> wrote: > Dear Stata users, > > I have to group the income variable in different intervals. In the > original dataset, the household income variable is grouped İnto 12 > categories > > J <40 > R [40,70] > C [70, 120] > M [120, 230] > F [230, 350] > S > K > P > D > H > U [1730, 2310) > N > 2310 > > I want to group J and R categories <70 Euros, and create dummy > variables for all income groups. That is the Stata ouput. I used the > recode command But it does not work > > gen hinc_gr=recode(hinctnt, 70, 120, 230, 350, 460, 580, 690, 1150, > 1730, > 2310) > (13282 missing values generated) > > . tab hinc_gr > > hinc_gr | Freq. Percent Cum. > ------------+----------------------------------- > 70 | 29,718 100.00 100.00 > ------------+----------------------------------- > Total | 29,718 100.00 > > Regards > > Antonio > > > > * > * 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/ * * 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/ * * 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/