I am using NLSY1979 panel data.
I want to sort my variable weightchange in ascending order, but I want to still see every weight observation for that ID. This way I can determine if the extreme weight values are mistakes or if they are reasonable weights in comparison to the ID's weights in every year. Using the code
sorts my data in data editor browse as:

I want all the observations for each caseID to show in order from the lowest weight change to highest. So it will show the ID for every year with the weightchange of -860 rather than just the year with the dramatic weight change.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int(caseid_1979 year weight) float weightchange 30 1990 170 -826 170 1990 178 -818 637 2008 225 -315 1207 2010 165 -426 2290 2006 250 -200 4120 2010 170 -295 4263 2018 188 -214 4429 1990 188 -808 7673 2016 135 -300 8151 1990 136 -860 8220 1990 139 -857 8331 2014 140 -200 10480 1990 170 -826 11984 1990 160 -836 end
I want to sort my variable weightchange in ascending order, but I want to still see every weight observation for that ID. This way I can determine if the extreme weight values are mistakes or if they are reasonable weights in comparison to the ID's weights in every year. Using the code
Code:
*sort weightchange caseid_1979
I want all the observations for each caseID to show in order from the lowest weight change to highest. So it will show the ID for every year with the weightchange of -860 rather than just the year with the dramatic weight change.
Comment