I am trying to find track the median quarterly wages for individuals based on the quarter they graduated, their demographic information, the program they graduated from, etc. For instance, if students graduated in 2012Q1 I would like to track their wages from 2012Q1 through 2020Q4 and be able to change the criteria quickly. Below is an example of the data I am dealing with.
People |grad.date|race|yrqtr|wage|program
PersonA|20121 |H |20121|50 |Health
PersonA|20121 |H |20122|50 |Health
PersonB|20122 |W |20121|50 |Business
PersonB|20122 |W |20122|75 |Business
PersonC|20131 |W |20131|100 |Business
PersonC|20131 |W |20132|50 |Business
PersonD|20121 |A |20121|100 |Economics
PersonD|20121 |A |20122|100 |Economics
Let's say I wanted to get the median wages for individuals that graduated in 2012Q1, the desired output would be:
People |grad.date|race|yrqtr |wage|program |Med.20121|Med.20122
PersonA|20121 |H |20121 |50 |Health |75 |75
PersonA|20121 |H |20122 |50 |Health |75 |75
PersonD|20121 |A |20121 |100 |Economics|75 |75
PersonD|20121 |A |20122 |100 |Economics|75 |75