----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(lograte time pred_withseason pred_withoutseason adm_year) byte adm_mon 5.984276 1 5.667077 5.748545 2006 4 5.647804 2 5.311514 5.747315 2006 5 5.291129 3 5.444794 5.746085 2006 6 5.910168 4 5.772729 5.744855 2006 7 5.984276 5 5.67867 5.743625 2006 8 5.743114 6 5.614248 5.742395 2006 9 5.910168 7 5.851193 5.741165 2006 10 5.42466 8 6.01965 5.739935 2006 11 6.564095 9 5.945833 5.738705 2006 12 6.505072 10 5.967428 5.737474 2007 1 5.966075 11 5.899466 5.736245 2007 2 5.811924 12 5.982559 5.735014 2007 3 4.42563 13 5.646421 5.733784 2007 4 5.272928 14 5.290859 5.732554 2007 5 5.891967 15 5.424139 5.731324 2007 6 5.406459 16 5.752075 5.730094 2007 7 5.724913 17 5.658015 5.728864 2007 8 5.891967 18 5.593593 5.727634 2007 9 5.724913 19 5.830538 5.726404 2007 10 6.21739 20 5.998995 5.725174 2007 11 6.099607 21 5.925178 5.723944 2007 12 6.214238 22 5.946773 5.722714 2008 1 5.808773 23 5.878811 5.721484 2008 2 5.626451 24 5.961904 5.720253 2008 3 5.403307 25 5.625767 5.719024 2008 4 5.521091 26 5.270204 5.717793 2008 5 5.403307 27 5.403484 5.716564 2008 6 5.721761 28 5.73142 5.715333 2008 7 6.096455 29 5.637361 5.714103 2008 8 5.888815 30 5.572938 5.712873 2008 9 5.888815 31 5.809884 5.711643 2008 10 4.933304 32 5.978341 5.710413 2008 11 5.115625 33 5.904523 5.709183 2008 12 5.853778 34 5.926118 5.707953 2009 1 6.122042 35 5.858156 5.706723 2009 2 6.061418 36 5.941249 5.705493 2009 3 5.36827 37 5.605112 5.704263 2009 4 4.675123 38 5.249549 5.703033 2009 5 5.486053 39 5.382829 5.701803 2009 6 5.773736 40 5.710765 5.700572 2009 7 6.379871 41 5.616705 5.699343 2009 8 5.591414 42 5.552283 5.698112 2009 9 5.927886 43 5.789228 5.696882 2009 10 6.233268 44 5.957685 5.695652 2009 11 6.233268 45 5.883868 5.694422 2009 12 6.368409 46 5.905463 5.693192 2010 1 5.916423 47 5.837501 5.691962 2010 2 5.842315 48 5.920594 5.690732 2010 3 5.675261 49 5.584457 5.689502 2010 4 5.474591 50 5.228894 5.688272 2010 5 5.474591 51 5.362175 5.687042 2010 6 5.223276 52 5.69011 5.685812 2010 7 6.049955 53 5.596051 5.684582 2010 8 5.762273 54 5.531628 5.683352 2010 9 5.356808 55 5.768574 5.682122 2010 10 5.356808 56 5.937031 5.680892 2010 11 5.675261 57 5.863213 5.679662 2010 12 5.47245 58 . . 2011 1 5.914283 59 . . 2011 2 5.47245 60 . . 2011 3 4.66152 61 4.945485 5.009988 2011 4 4.373838 62 4.5899224 5.008758 2011 5 4.66152 63 4.723202 5.007528 2011 6 4.66152 64 5.051137 5.006298 2011 7 5.354667 65 4.957078 5.005068 2011 8 4.884664 66 4.892656 5.003838 2011 9 5.066985 67 5.129601 5.002607 2011 10 5.354667 68 5.298059 5.001378 2011 11 4.66152 69 5.224241 5.000147 2011 12 5.211245 70 5.245836 4.998917 2012 1 5.462559 71 5.177874 4.997687 2012 2 5.462559 72 5.260967 4.996457 2012 3 4.874772 73 4.92483 4.995227 2012 4 3.9584816 74 4.5692673 4.993997 2012 5 4.3639464 75 4.702547 4.992767 2012 6 5.344776 76 5.030483 4.991537 2012 7 4.3639464 77 4.936423 4.990307 2012 8 3.9584816 78 4.872001 4.989077 2012 9 4.874772 79 5.108947 4.987847 2012 10 5.973384 80 5.277404 4.986617 2012 11 4.6516285 81 5.203586 4.985387 2012 12 5.354535 82 5.225181 4.984157 2013 1 4.661388 83 5.157219 4.982926 2013 2 4.884531 84 5.240312 4.981697 2013 3 5.066853 85 4.904175 4.980466 2013 4 4.884531 86 4.5486126 4.979236 2013 5 5.066853 87 4.6818924 4.978006 2013 6 5.066853 88 5.009828 4.976776 2013 7 4.373706 89 4.915769 4.975546 2013 8 5.221004 90 4.851346 4.974316 2013 9 5.066853 91 5.088292 4.973086 2013 10 5.672989 92 5.256749 4.971856 2013 11 3.968241 93 5.182931 4.970626 2013 12 5.230325 94 5.204526 4.969396 2014 1 5.587 95 5.136564 4.968166 2014 2 5.68231 96 5.219657 4.966936 2014 3 4.893853 97 4.88352 4.965705 2014 4 4.893853 98 4.5279574 4.964476 2014 5 5.587 99 4.6612372 4.963245 2014 6 5.363856 100 4.989173 4.962015 2014 7 end
Listed 100 out of 165 observations
Use the count() option to list more
code
set scheme s2color
twoway (scatter lograte time if time, msize(vsmall) xline(57, lpattern(shortdash) lwidth(thin) lcolor(black)) ///
xline(61, lpattern(shortdash) lwidth(thin) lcolor(black))) ///
(line pred_withseason time if time<58,lcolor(green)) (line pred_withseason time if time>60,lcolor(green)) ///
(line pred_withoutseason time if time<58, lwidth(thin) lcolor(cranberry)) (line pred_withoutseason time if time>60, lwidth(thin) lcolor(cranberry)), ///
graphregion(color(white)) ylab(3.91 "50" 4.61 "100" 5.30 "200" 5.99 "400" 6.40 "600", angle(hor) labsize(vsmall) nogrid) xtitle("Years", size(small)) ytitle("Incidence rates per 100,000 person-years(log{subscript:10}scale)", size(small)) ///
bgcolor(white) legend(position(2) cols(1) size(vsmall) order(1 2 4) symxsize(2)lab(1 "Monthly incidence") lab(2 "Temporal trend and season") lab(4 "Temporal trend") width(26) region(lcolor(white))) xlab(5 "2006" 15.5 "2007" 27.5 "2008" 39.5 "2009" 51.5 "2010" 63.5 "2011" ///
75.5 "2012" 87.5 "2013" 99.5 "2014" 111.5 "2015" 123.5 "2016" 135.5 "2017" 147.5 "2018" 159.5 "2019", noticks labsize(vsmall)) yscale(titlegap(*6)) xscale(titlegap(*6)) ///
title("{bf:radiologically-defined pneumonia 2-59 months}", size(small)) xsize(9) ysize(5) plotregion(margin(zero)) xtick(0 9 21 33 45 57 69 81 93 105 117 129 141 153 165 )
e
Dear all,
Above is my code and data, why is it that if I use plotregion(margin(zero)) the two data points of 2016 (june and december ) which are 3.31 for lograte fall in x-axis line? I just want x and y axis to meet at zero (0,0).Does this mean x and y-axis meet at (3.31,0)? i.e is x-axis drawn at 3.31 ?.Maybe am not getting something.Kindly assist
Comment