Dear Statalist:
I'm navigating a dataset by making a series of two-way plots across multiple years and I found something strange with the plots. Some groups have the year in the x-axis, while others don't.
Some example codes that I used are...
To examine how pay changed across years by agencies, I used the following code. Here, Only some agencies have years in the x-axis.
Graph.gph
As another example, to examine how pay changed across years by type of work schedules, I used the following code. Again, only some categories have years in the x-axis.
Graph2.gph
My data looks like this:
. dataex agy year adjbasicpay worksch
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Listed 100 out of 238924 observations
Use the count() option to list more
Thanks.
I'm navigating a dataset by making a series of two-way plots across multiple years and I found something strange with the plots. Some groups have the year in the x-axis, while others don't.
Some example codes that I used are...
To examine how pay changed across years by agencies, I used the following code. Here, Only some agencies have years in the x-axis.
Code:
twoway (line avg_adjbasicpay year), by(agy)
As another example, to examine how pay changed across years by type of work schedules, I used the following code. Again, only some categories have years in the x-axis.
Code:
twoway (scatter adjbasicpay year), by(worksch)
My data looks like this:
. dataex agy year adjbasicpay worksch
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str2 agy int year long adjbasicpay str21 worksch "AG" 2005 37185 "Full-time" "AG" 2005 47001 "Full-time" "AG" 2005 40904 "Full-time" "AG" 2005 26831 "Part-time" "AG" 2005 62371 "Full-time" "AG" 2005 49414 "Full-time" "AG" 2005 39030 "Intermittent" "AG" 2005 64206 "Full-time" "AG" 2005 53064 "Full-time" "AG" 2005 47802 "Full-time" "AG" 2005 30020 "Part-time" "AG" 2005 37185 "Full-time" "AG" 2005 56095 "Full-time" "AG" 2005 43925 "Full-time" "AG" 2005 43383 "Intermittent" "AG" 2005 40904 "Part-time" "AG" 2005 30020 "Intermittent" "AG" 2005 37185 "Full-time" "AG" 2005 53531 "Full-time" "AG" 2005 37185 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 54579 "Full-time" "AG" 2005 45298 "Full-time" "AG" 2005 51548 "Full-time" "AG" 2005 88895 "Full-time" "AG" 2005 81347 "Full-time" "AG" 2005 56095 "Full-time" "AG" 2005 37185 "Intermittent" "AG" 2005 49129 "Intermittent" "AG" 2005 94123 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 53531 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 50032 "Full-time" "AG" 2005 48516 "Full-time" "AG" 2005 79149 "Full-time" "AG" 2005 88895 "Full-time" "AG" 2005 64206 "Full-time" "AG" 2005 45485 "Full-time" "AG" 2005 47001 "Full-time" "AG" 2005 38424 "Intermittent" "AG" 2005 64206 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 42553 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 37185 "Full-time" "AG" 2005 67875 "Full-time" "AG" 2005 31021 "Intermittent" "AG" 2005 85744 "Full-time" "AG" 2005 48516 "Full-time" "AG" 2005 33462 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 47001 "Full-time" "AG" 2005 32196 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 50786 "Full-time" "AG" 2005 57611 "Full-time" "AG" 2005 76951 "Full-time" "AG" 2005 40904 "Full-time" "AG" 2005 44622 "Full-time" "AG" 2005 70356 "Full-time" "AG" 2005 41271 "Full-time" "AG" 2005 37185 "Part-time" "AG" 2005 79149 "Full-time" "AG" 2005 30020 "Intermittent" "AG" 2005 42143 "Full-time" "AG" 2005 56095 "Full-time" "AG" 2005 53531 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 26831 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 54579 "Full-time" "AG" 2005 39664 "Full-time" "AG" 2005 86280 "Full-time" "AG" 2005 60537 "Full-time" "AG" 2005 105048 "Full-time" "AG" 2005 86280 "Full-time" "AG" 2005 65960 "Full-time" "AG" 2005 134473 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 51548 "Full-time" "AG" 2005 48516 "Full-time" "AG" 2005 83546 "Full-time" "AG" 2005 41271 "Full-time" "AG" 2005 33462 "Part-time" "AG" 2005 79149 "Full-time" "AG" 2005 30020 "Part-time" "AG" 2005 47001 "Full-time" "AG" 2005 116299 "Full-time" "AG" 2005 79149 "Full-time" "AG" 2005 43502 "Full-time" "AG" 2005 112664 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 34578 "Full-time" "AG" 2005 59127 "Full-time" "AG" 2005 56095 "Full-time" "AG" 2005 51548 "Full-time" "AG" 2005 53064 "Full-time" "AG" 2005 65960 "Full-time" "AG" 2005 111228 "Full-time" end
Listed 100 out of 238924 observations
Use the count() option to list more
Thanks.

Comment