/* the code below will produce a table of quantiles from t-distributions with various integer degrees of freedom from 1 up to 120, with the quantiles from the standard normal in the last row. Also, it can be included into typesetting software such as LaTeX to make a pretty finished product, like the one linked at the bottom of the lab 10 webpage. */ options ls=100; /* needs to be wide enough to prevent text from wrapping to next line in .lst file */ data one; array alpha a1-a8 (0.2,0.15,0.1,0.05,0.025,0.01,0.005,0.001); array tstar t1-t8; /* arrays make it easy to process critical values for the whole group of alphas all at once */ /* alpha is a vector whose components may easily be referenced e.g. alpha{2}=0.15 */ /* tstar just groups and names columns for easy reference, e.g. t2 is the column corresponding to alpha=.15 */ do df=1 to 30,40 to 100 by 10,200,100000; /* note the rows produced by this looping with irregular increments*/ do i=1 to 8; tstar{i}=tinv(1-alpha{i},df); amper="&"; /* this is particular to making tables with LaTeX typesetting software (column separators) */ eol="\\"; /* this is particular to making tables with LaTeX typesetting software (end of line chars) */ end; output; end; run; proc print noobs; var df amper t1 amper t2 amper t3 amper t4 amper t5 amper t6 amper t7 amper t8 eol; *var df t1-t8; run;