/***************************************************************************************************************** SAS file name: F_Curves.sas File location: _________________________________________________________________________________________________________________ Purpose: To draw densities and cummulative density curves for three different F distributions Author: Peter Clemmensen Creation Date: 16/02/207 This Program supports the Example page "F-Distribution" on SASnrd.com *****************************************************************************************************************/ /* Create F PDF data */ data Beta_PDF; do x=0 to 3 by 0.01; pdf1=pdf('F', x, 3, 8); pdf2=pdf('F', x, 8, 3); pdf3=pdf('F', x, 20, 20); output; end; run; /* Draw PDF plots */ title "F Densities"; title2 "For Different Values of d1 and d2"; proc sgplot data = Beta_PDF noautolegend; series x=x y=pdf1 / lineattrs=(thickness=3) legendlabel="d1=3 d2=8"; series x=x y=pdf2 / lineattrs=(thickness=3) legendlabel="d1=8 d2=3"; series x=x y=pdf3 / lineattrs=(thickness=3) legendlabel="d1=20 d2=20"; keylegend / position=NE location=inside across=1 noborder valueattrs=(Size=12 Weight=Bold); yaxis min=0 max=1 label="PDF" labelattrs=(size=12 weight=Bold); xaxis min=0 max=3 label='x' labelattrs=(size=12 weight=Bold); run; title; /* Create F CDF data */ data Beta_CDF; do x=0 to 3 by 0.01; cdf1=cdf('F', x, 3, 8); cdf2=cdf('F', x, 8, 3); cdf3=cdf('F', x, 20, 20); output; end; run; /* Draw CDF plots */ title "F Cumulative Density Functions"; title2 "For Different Values of d1 and d2"; proc sgplot data = Beta_CDF noautolegend; series x=x y=cdf1 / lineattrs=(thickness=3) legendlabel="d1=3 d2=8"; series x=x y=cdf2 / lineattrs=(thickness=3) legendlabel="d1=8 d2=3"; series x=x y=cdf3 / lineattrs=(thickness=3) legendlabel="d1=20 d2=20"; keylegend / position=NW location=inside across=1 noborder valueattrs=(Size=12 Weight=Bold); yaxis min=0 max=1 label="CDF" labelattrs=(size=12 weight=Bold); xaxis min=0 max=3 label='x' labelattrs=(size=12 weight=Bold); run; title;