Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • real salary matrix calculation

    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.

  • #2
    Yes, I think that matrices and the -mean- command will be not helpful for you might want to do. However, we can only guess about the structure of your data, and of what your purpose might be. To that end, please post an example data set, with an illustration of the result you want, if possible. The FAQ describes how to show example data using the -dataex- command, which will make this easier for you. (You can also see examples of this in other questioners' postings.) I'd also note that the meanings of "d.realsalary" and "l.realsalary" are not at all obvious to me, even though I have often worked with adjusting income figures for inflation, so you'll want to explain such things.

    Comment


    • #3
      thank you Mike Lacy, you confirmed my suspects
      Anyway, I have quarterly data dy province of labour force relevations, already collapsed and merged to create a panel of provinces, years and quarters.
      To get back to my issue, I managed to merge into my ds yearly estimation of consumer price index and to calculate my real wage just by (nominal/cpi)*100, generating a new var.
      I guess this easier way has worked well enough. I would have liked to do yearly means for each province and then divide these means by cpi, but I think what I did it's ok anyway.
      Still, thank you very much for your answer.

      Comment

      Working...
      X