input ///
i t y x
1 1 1 2
1 2 3 4
2 1 5 6
2 2 7 8
3 1 4 5
3 2 4 7
end
set seed 2012
sort i t
reshape wide y x, i(i) j(t)
sample 80 //draw a 80% sample
reshape long y x, i(i) j(t)