I have panel data on income by occupation and year. Using "xtset occupation year" and then "xtline income" I get a nice graph. Now I egen a new variable, medwage, for the median wage by year. medwage doesn't have an occupation. I want to plot the incomes including medwage. I can do the following:
xtline income, overlay addplot( line medwage year if occupation==1 )
where the 1 is an arbitrary occupation since medwage repeats on each panel. That works ok but it seems like there should be a simple way to take medwage and insert it into the panel with a new occupation code so I can just run
xtline income
and have everything run including the medwage. If there isn't a simple way I will stick with what I am doing. I imagine this problem has been dealt with before but I probably searched on the wrong keywords.
xtline income, overlay addplot( line medwage year if occupation==1 )
where the 1 is an arbitrary occupation since medwage repeats on each panel. That works ok but it seems like there should be a simple way to take medwage and insert it into the panel with a new occupation code so I can just run
xtline income
and have everything run including the medwage. If there isn't a simple way I will stick with what I am doing. I imagine this problem has been dealt with before but I probably searched on the wrong keywords.
Comment