I have a data set that containing two time series data. One is y, the other is predicted y. I want to draw a overly histogram graphic for the two series in one graph.
data a;
input y haty;
datalines;
2 2.1
2.12 2.24
2.3 2.5
3.1 3.1
1.23 0.98
;
run;
I have a sample code for Defining a Template That Overlays Two Histograms.
proc template;
define statgraph dualhist;
begingraph;
entrytitle "Graph"; /** optional title **/
layout overlay / xaxisopts=(label="Length");
/** first plot: a histogram **/
histogram y / name="Y"
binwidth=5;
/** second plot: a semi-transparent histogram **/
histogram haty / name="Predicted Y"
binwidth=5 datatransparency=0.7
fillattrs=(color=GraphData2:color);
/** optional: add legend by specifying names **/
discretelegend "y" "haty";
endlayout;
endgraph;
end;
run;
proc sgrender data=a template=dualhist;
run;
I need some help on the statgraph, especially for the x axis. I want y axis to be the value of y and haty.