Dear Stata listers,
I have a panel-dataset which includes companies (different variables) and their salaries over the time period from 2004 to 2014.
The salaries are not given in absolut numbers, but in relative numbers. ("salary year t / salary of the year with the maximum salary").
Now I want to detrend the variable "salary".
Other internet forums suggest following code:
generate Trend = YEAR - 2003
reg Salary Trend
predict Salary_detrend, resid
In consideration of the panel data set, I have now the question, if I can use this code?
Or should I use the following code for my panel dataset?
xtreg Salary Trend, fe vce (cluster ID)
predict Salary_detrend_fe, e
Can someone help me on this? Thank you.
I have a panel-dataset which includes companies (different variables) and their salaries over the time period from 2004 to 2014.
The salaries are not given in absolut numbers, but in relative numbers. ("salary year t / salary of the year with the maximum salary").
Now I want to detrend the variable "salary".
Other internet forums suggest following code:
generate Trend = YEAR - 2003
reg Salary Trend
predict Salary_detrend, resid
In consideration of the panel data set, I have now the question, if I can use this code?
Or should I use the following code for my panel dataset?
xtreg Salary Trend, fe vce (cluster ID)
predict Salary_detrend_fe, e
Can someone help me on this? Thank you.
Comment