Statalist The Stata Listserver


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

Re: st: Creating a indicator of the number of job with highest wage


From   "Kelvin Foo" <kelvinski@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Creating a indicator of the number of job with highest wage
Date   Mon, 5 Feb 2007 13:18:33 +0800

Hi,

reshape long w_job, i(ID) j(jobnum)
gsort id -w_job
by id: gen Number_job=jobnum[1]
reshape wide w_job, i(ID) j(jobnum)

Hope this helps,
Kelvin.


On 2/5/07, Hui Wang <jackie_stata@hotmail.com> wrote:
Hi, All,

I have a dataset. Each individual can at most have 4 jobs (job1-job4). For
each individual I know the hourly wage for each job (w_job1-w_job4). I
wonder how I can creat a variable indicating that which job has the highest
wage. Refer to the following example. The variable I want to creat is the
'Number_job'

ID w_job1 w_job2 w_job3 w_job4 Number_job
1  10        100      0          0         2
2  120      30        10        0         1
3  20        90        80        70       2

Thanks.

Jackie

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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



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