This may be a naive question but I am running a regression of a variable on a set of other variables.
But each country has several observations and the original regression has a pooled sample. Now I want the averages of each country and run a regression on the averages.
For example I have 50 countries and each country has either 3 or 4 observations. Now I want an average of each variable by country. So that in the end every independent/dependent variable has 50 observations, one for each country.
Right now I am using the aggregate command but its creating a variable with country name and average value both. So I am not able to run a regression on these variables.
This for example what I have
Country/ some-observation/ Some-other-observation/ some-other-observation-2
Somalia/ 3 / 7 / . ...
USA/ 7 / 8 / ...
Nigeria/ 5/ 8 / ...
Nigeria/ 9 / 2 / ..
India/ 4 / 7/ ..
India/ 7 / 9/ ..
UK/ 8 / 1/ ..
UK /5/ 5 / ..
etc