I have a year variable in my longitudinal data and I am trying to use xtline to plot a graph. year is my time variable and company is the id variable. While using the command
"xtline var1 if var2==5, t(year) i(company) overlay" I expect the values of the variable year (1995 to 2016) to appear on the x axis of the graph. However, what is displayed are values from 1 to 21. when I do a tab command (tab year) it correctly shows the years as different values for the year. When I go to the data sheet also, it displays values from 1995 to 2016. But, when I do "codebook year" it returns range as "range: [1,21]"
Can some one tell me how can I force xtline to display the actual years on the x axis instead of these values from 1 to 21.
I tried adding "xlabel(1995(2)2016)" option with the xtline command. That is not giving the desired output. It essentially displays the lines corresponding to 1 to 21 in the beginning of the graph and leaves a huge blank space in the graph after 21 with values 1995-2016 clustered at the end of x axis.
Thaks in advance for your help.
"xtline var1 if var2==5, t(year) i(company) overlay" I expect the values of the variable year (1995 to 2016) to appear on the x axis of the graph. However, what is displayed are values from 1 to 21. when I do a tab command (tab year) it correctly shows the years as different values for the year. When I go to the data sheet also, it displays values from 1995 to 2016. But, when I do "codebook year" it returns range as "range: [1,21]"
Can some one tell me how can I force xtline to display the actual years on the x axis instead of these values from 1 to 21.
I tried adding "xlabel(1995(2)2016)" option with the xtline command. That is not giving the desired output. It essentially displays the lines corresponding to 1 to 21 in the beginning of the graph and leaves a huge blank space in the graph after 21 with values 1995-2016 clustered at the end of x axis.
Thaks in advance for your help.
Comment