Dear all,
For some reason, when I run this code on the dataset, egen creates a variable containing the observation number of each row instead of the maximum within observations. I just can't seem to figure out what's going on. Thank you in advance!
The code is:
The dataset looks like:
For some reason, when I run this code on the dataset, egen creates a variable containing the observation number of each row instead of the maximum within observations. I just can't seem to figure out what's going on. Thank you in advance!
The code is:
Code:
egen maxv = rowmax(__*) sum maxv
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(__BS111400_p __BS111A00_p __BS112500_p maxv)
.02986717 .002714447 0 1
.072100684 .06976562 .000021618145 2
4.318047e-06 .000016268317 .013628376 3
.0019975295 .02660001 .01942118 4
.00011598477 .0001928249 .00017276 5
1.0046353e-10 3.17521e-10 .02495834 6
.00027324088 .00020779375 .00002767016 7
.006443177 .012688478 .008952809 8
.025992706 .003201397 .00483725 9
.00007730682 .00003245989 .00002056536 10
end
