Hi. I would like to create the graph on the left. My code below, however, creates the graph on the right. I am unable to take off the bits above and below the graph ("Intervention starts..." and "GEE model...."). I am also unable to remove the fitted value line and add the lfit line to this.
Any help in doing so will be very much appreciated.
Any help in doing so will be very much appreciated.
Code:
*code xtset con_id week_num xtitsa week_doctele i.age_cat i.doc_desig i.gender_cat i.department_cat i.LVPexp_cat /// week_num, single trperiod(78; 114) posttrend figure (legend(order(1 "observed" 2 "fitted values") size(small)) title("Hyderabad") /// ytitle("Number of consultations") ylabel(#4, labsize(small) angle(horizontal)) /// xline(145) xlab(35 "(1 Jan '22 - 29 Jun '23)" 95 "(30 June, 2023 - 5 Mar, 2024)" 127 "(6 Mar, 2024 - 31 Jul, 2024)", noticks labsize (vsmall)) /// xtick(`tickcall', tlength(*2)) xline(78) xline(114) scheme(s1color)) /// replace *data input long con_id float(week_num week_doctele age_cat) byte doc_desig float(gender_cat department_cat LVPexp_cat) 1 118 .03448276 2 1 1 6 1 1 119 .01724138 2 1 1 6 1 1 120 .01724138 2 1 1 6 1 1 121 .03448276 2 1 1 6 1 1 126 .03448276 2 1 1 6 1 1 128 .01754386 2 1 1 6 1 1 131 .05263158 2 1 1 6 1 1 135 .071428575 2 1 1 6 1 2 5 .12068965 2 3 2 8 1 2 6 .05172414 2 3 2 8 1 2 7 .05172414 2 3 2 8 1 2 8 .12068965 2 3 2 8 1 2 9 .1754386 2 3 2 8 1 2 11 .19298245 2 3 2 8 1 2 13 .24561404 2 3 2 8 1 2 15 .2105263 2 3 2 8 1 2 17 .22807017 2 3 2 8 1 2 19 .16949153 2 3 2 8 1 2 20 .15254237 2 3 2 8 1 2 21 .10169491 2 3 2 8 1 2 23 .22413793 2 3 2 8 1 2 24 .14035088 2 3 2 8 1 2 25 .1754386 2 3 2 8 1 2 26 .19298245 2 3 2 8 1 2 27 .07017544 2 3 2 8 1 2 28 .24561404 2 3 2 8 1 2 29 .05263158 2 3 2 8 1 2 30 .15789473 2 3 2 8 1 2 31 .13793103 2 3 2 8 1 2 32 .25862068 2 3 2 8 1 2 33 .0862069 2 3 2 8 1 2 34 .1551724 2 3 2 8 1 2 35 .1551724 2 3 2 8 1 2 36 .2413793 2 3 2 8 1 2 37 .10344828 2 3 2 8 1 2 38 .1551724 2 3 2 8 1 2 39 .13793103 2 3 2 8 1 2 40 .10344828 2 3 2 8 1 2 41 .10344828 2 3 2 8 1 2 42 .12068965 2 3 2 8 1 2 43 .1724138 2 3 2 8 1 2 44 .10526316 2 3 2 8 1 2 45 .12280702 2 3 2 8 1 2 46 .19298245 2 3 2 8 1 2 47 .12280702 2 3 2 8 1 2 48 .14035088 2 3 2 8 1 2 49 .05263158 2 3 2 8 1 2 50 .12280702 2 3 2 8 1 2 51 .2105263 2 3 2 8 1 2 52 .12280702 2 3 2 8 1 2 53 .1754386 2 3 2 8 1 2 54 .12280702 2 3 2 8 1 2 55 .2631579 2 3 2 8 1 2 57 .08064516 2 3 2 8 1 2 59 .2580645 2 3 2 8 1 2 61 .1935484 2 3 2 8 1 2 62 .06451613 2 3 2 8 1 2 63 .06451613 2 3 2 8 1 2 64 .12903225 2 3 2 8 1 2 65 .11290322 2 3 2 8 1 2 66 .09836066 2 3 2 8 1 2 67 .1147541 2 3 2 8 1 2 68 .13114753 2 3 2 8 1 2 69 .08196721 2 3 2 8 1 2 72 .21311475 2 3 2 8 1 2 73 .06557377 2 3 2 8 1 2 75 .1967213 2 3 2 8 1 2 76 .1147541 2 3 2 8 1 2 77 .09836066 2 3 2 8 1 2 78 .18032786 2 3 2 8 1 2 79 .18333334 2 3 2 8 1 2 81 .2 2 3 2 8 1 2 82 .15 2 3 2 8 1 2 83 .15 2 3 2 8 1 2 84 .18333334 2 3 2 8 1 2 85 .18644068 2 3 2 8 1 2 87 .220339 2 3 2 8 1 2 89 .3050847 2 3 2 8 1 2 90 .16949153 2 3 2 8 1 2 91 .20338982 2 3 2 8 1 2 93 .13559322 2 3 2 8 1 2 96 .220339 2 3 2 8 1 2 97 .220339 2 3 2 8 1 2 98 .18644068 2 3 2 8 1 2 99 .15254237 2 3 2 8 1 2 102 .16949153 2 3 2 8 1 2 103 .15254237 2 3 2 8 1 2 104 .20338982 2 3 2 8 1 2 109 .13793103 2 3 2 8 1 2 111 .1724138 2 3 2 8 1 2 113 .29310346 2 3 2 8 1 2 114 .13793103 2 3 2 8 1 2 116 .18965517 2 3 2 8 1 2 117 .20689656 2 3 2 8 1 2 118 .2413793 2 3 2 8 1 2 119 .1724138 2 3 2 8 1 2 120 .0862069 2 3 2 8 1 2 121 .13793103 2 3 2 8 1 2 122 .18965517 2 3 2 8 1 2 123 .18965517 2 3 2 8 1
Comment