(*  student_cdf_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the Student CDF *)
(*    at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  13 February 2006 *)
(*  Author:  John Burkardt *)

Needs["Statistics`ContinuousDistributions`"]

nvec = { 1,2,3,4,
5,2,5,2,
5,2,3,4,
5};
xvec={325/1000,
289/1000,
277/1000,
271/1000,
267/1000,
816/1000,
727/1000,
2920/1000,
2015/1000,
6965/1000,
4541/1000,
3747/1000,
3365/1000 };
fvec = {};
num = Length [ xvec ];

Do[{ n = nvec[[i]], x= xvec[[i]],
dist = StudentTDistribution[n], f = N[CDF[dist,x],16],
fvec = Append [ fvec, f ],
Print["StudentTCDF[",n,"](",x,")=",f]
}, {i, 1, num,1}]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\student_cdf_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  student_cdf_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  n  x  f"];
Write[fileout,"#"];
Do[{n=nvec[[i]];x=xvec[[i]];f=fvec[[i]];Write[fileout,n,"  ",N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];