When used as a stand-alone
plot or overlaid with other density plots, the dependent axis shows
the computed density values.
proc template;
define statgraph densityplot1;
begingraph;
entrytitle "Fitted Density Curves";
entrytitle "of Patient Weight";
entryfootnote halign=left "Framingham Heart Study";
layout overlay;
densityplot weight / normal()
lineattrs=graphfit name="n" legendlabel="Normal";
densityplot weight / kernel()
lineattrs=graphfit2 name="k" legendlabel="Kernel";
discretelegend "n" "k";
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.heart template=densityplot1;
label weight="Patient Weight";
run;
When one or more density
plots are overlaid on a histogram, the dependent axis shows the statistic
indicated by the histogram’s SCALE= option. The area under
each density curve is equal to the area of the histogram.
proc template;
define statgraph densityplot2;
begingraph;
entrytitle "Patient Weight Distribution";
entrytitle "with Fitted Normal Curve";
entryfootnote halign=left "Framingham Heart Study";
layout overlay;
histogram weight / primary=true scale=count;
densityplot weight / normal() lineattrs=graphfit;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.heart template=densityplot2;
label weight="Patient Weight";
run;