Statalist The Stata Listserver


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

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


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: Re: Re: st: Creating a indicator of the number of job with highest
Date   Mon, 05 Feb 2007 21:50:53 +0000

Here is one solution that is not messed up by
any missings:

reshape long w_job, i(ID) j(jobnum)
bysort ID (w_job): ///
	gen Number_job = cond(w_job < ., jobnum, jobnum[_n-1])
by ID : replace Number_job = Number_job[_N]
reshape wide w_job, i(ID) j(jobnum)

This still leaves yet another problem: if two or more
jobs tie for maximum wage, then only one of them is recorded.

Nick
[email protected]


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