1

I'm trying to create a line of code in R that does the same as the following one in Stata

by country essround: egen mpppincome=mean(income_ppp2010)

But I'm not really sure how to proceed

Any ideas? (The line is supossed to calculate the mean income per country and year from the dataset, which contains income measures from individuals with a country identifying variable and a year identifying variable)

ffolkvar
  • 47
  • 4
  • 1
    To compute aggregate statistics is one of the most asked questions, see [here](https://stackoverflow.com/questions/18944668/get-the-means-of-sub-groups-of-means-in-r). – Rui Barradas Nov 19 '20 at 16:10

0 Answers0