Hi, I am confused if egen by is equivalent to bysort egen:
For example, I have a panel data for multiple years and I want to get the mean of income for each individuals across waves
I have two command:
1. bysort id: egen incomeMean = mean(Income)
2. egen incomeMean = mean(Income), by(id)
Are these two commands produce the same thing? I tried in my own sample and it showed that the two results are the same, but I just want to make sure these two are really the same.
For example, I have a panel data for multiple years and I want to get the mean of income for each individuals across waves
I have two command:
1. bysort id: egen incomeMean = mean(Income)
2. egen incomeMean = mean(Income), by(id)
Are these two commands produce the same thing? I tried in my own sample and it showed that the two results are the same, but I just want to make sure these two are really the same.
Comment