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   "Quang Nguyen" <[email protected]>
To   [email protected]
Subject   Re: st: Creating a indicator of the number of job with highest wage
Date   Sun, 4 Feb 2007 22:05:02 -1000

Dear Kevin and Hui,

Thanks Hui for raising the question and Kevin for such an excellent
answer. It works brillian!
Have A Wonderful Day!

On 2/4/07, Kelvin Foo <[email protected]> wrote:
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 <[email protected]> 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/

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