Hey,
I'd like to calculate averages of different groups and get information on the number of observations used, like in the following example:
In this case there are no missing values, hence the number of observations is always the same. In my case this is not the case and I would like to know how many observations are non-missing for each group. The --mean-- command stores the number of observations in the results. Is there a way to get the results even if I use --by--?
Thanks in advance!
I'd like to calculate averages of different groups and get information on the number of observations used, like in the following example:
Code:
webuse union, clear by id: egen mean_age = mean(age)
Thanks in advance!
Comment