Announcement

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

  • Matching value from table to observation in data

    Can I match values from a table in excel to observations in my data?

    Let me describe what I have first to hopefully provide a clear picture of my issue. I have a data set with individual people and how long they have worked with an organization. I also have a pay table (separate file) that provides monthly salaries based off rank in organization and time with organization (Row titles: rank; column titles: time). What I am trying to do is match a person's monthly salary from the pay chart to their observation in my data. Is that possible?

  • #2
    Welcome to Statalist!

    I believe what you want to do is to import the Excel table into Stata, and then convert it from "wide" organization to "long" organization, where each observation will be identified by rand and time, with a single column of salaries. You should then be able to merge that with your existing dataset of employees.

    See the help files or the PDF documentation for more information on the following key commands.
    • import excel
    • reshape long
    • merge (for which you will want to do a 1:m merge - each individual will match to one salarie, the salaries may match to multiple individuals)

    Comment


    • #3
      Thanks for the help William.

      Comment

      Working...
      X