Try
egen series = rmin(series1 series2 series3)
gen which = 1 * !mi(series1) + 2 * !mi(series2) + 3 * !mi(series3)
drop series?
reshape wide series , i(country year) j(which)
Nick
[email protected]
[email protected]
> I have what may be a basic question. I have data like this:
> country year series1 series2 series3
> 1 1 1000 . .
> 1 2 1035 . .
> 1 1 . 50 .
> 1 2 . 53 .
> 1 1 . . 7
> 1 2 . . 8.5
> 2 etc
>
>
> Is there anyway I can basically collapse these so that:
> country year series1 series2 series3
> 1 1 1000 50 7
> 1 2 1035 53 8.5
>
> for a number of countries?
*
* 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/