Hi all,

I would like to generate a matrix that contains in the first column the average of a variable, grouped by year, something like what comes from
Code:
 mean salary, over(year) cluster (region)
in the second the values of inflation coming from an external source and in the third column the product of the two and somehow make a "realsalary" variable out of it, in order to do something like (d.realsalary/l.realsalary)*100 to evaluate the average trend over years of real salaries.
the fact is that I have never worked with matrices in stata and I don't know how to approach this whole operation. I am not even sure matrices are the best way to do this, indeed.

Any suggestion?

Thanks everyone.