I am trying to graph monthly prevalence of 2 diseases over a 6 year time period. I'm using proc sgpanel to break up the 4 hospitals data. I'm using the 'band' function to delineate between pre and post an EHR changeover. I created a dummy variable to indicate which EHR was associated with that particular year/month (my x-axis is date). Everything seemed to work...EXCEPT - I have a white band between the banded groups. I have checked the underlying data several times and there is no gap in the data. I have read the documentation on the band function, consulted several books and even asked ChatGPT (which did horrible!). There's really nothing of value from the log and again, there are no gaps in the data that would indicate there should be a white space here. Here is the code (a few var names changed): proc sgpanel data=enc;
where fisc_monyr >= '01Nov2015'd;
panelby hosp / layout=rowlattice onepanel novarname uniscale=column;
series x=fisc_monyr y=var1 / Name="var1" legendlabel='varname' lineattrs=(color=black);
series x=fisc_monyr y=var2 / Name="var2" legendlabel='varname2' lineattrs=(color=crimson);
band x=fisc_monyr upper=var1 lower=0 /name="band" legendlabel="bandvar" NOMISSINGGROUP
group=post_gen transparency=0.7;
format post_gen post_genf.;
colaxis grid
values=('01Nov2015'd, '01Nov2016'd to '01Nov2020'd by year,'01Oct2021'd)
offsetmin=0 offsetmax=0
valuesformat=monyy.
label="Month-Year"
;
rowaxis grid
label="Encounters per month";
format fisc_monyr monyy.;
/*Add refline for ehr date*/
refline covid_start / name="cov" axis=x label=covid_label
labelattrs=(color=black Family=arial
size=7) legendlabel="COVID19 Start"
lineattrs=(color=black
pattern=dot
thickness=1)
;
keylegend "var1" "var2" "band";
run; Here is the band I was referring to: The white space between the blue and red fill. Is there anything obvious I'm doing wrong here? Thanks in advance for all your help. This community has been so great in helping to build this graph.
... View more