Hi ,

I have a huge dataset with 12000 observations with sample ID running in sequence (1-12000). I am interested to calculate mean of (Cholesterol) for every 100 observations. How do I write a code for that?

Is it:

egen avechol = mean(Cholesterol), by ()

I don't know what to write in the by() syntax?

Please help!

Many thanks.