creating new variables in STATA - strange problem

#1
Hello,

I have a very simple stata question.

I have a dataset of counties in the US and also crime rates for four years (panel data)

What I am trying to do is generating a new variable that would be crime rate averages for counties.

So I am typing "sort county" and then "by county: gen av_crime_county=e(crimerate)".

I am getting a new variable, but only missing variables are created... Where am I making a mistake?

It's probably something small and stupid - I took econometrics some time ago and now I am doing a research paper for another course, but I just don't remember some details.

Would it be glad for some help!