Category : Pascal Source Code
Archive   : PIBSIGS.ZIP
Filename : SIGCHI.PAS

 
Output of file : SIGCHI.PAS contained in archive : PIBSIGS.ZIP
(*-------------------------------------------------------------------------*)
(* SigChi -- Significance of Chi-Square distribution *)
(*-------------------------------------------------------------------------*)

FUNCTION SigChi( Chisq , Df : REAL ) : REAL;

(*-------------------------------------------------------------------------*)
(* *)
(* Function: SigChi *)
(* *)
(* Purpose: Evaluates Chi-Square distribution probability *)
(* *)
(* Calling Sequence: *)
(* *)
(* P := SigChi( Chisq , Df ); *)
(* *)
(* Chisq --- Chi-square value *)
(* Df --- Degrees of freedom *)
(* *)
(* P --- Resultant probability *)
(* *)
(* Calls: *)
(* *)
(* GammaIn *)
(* *)
(* Method: *)
(* *)
(* The input values are transformed to match the *)
(* requirements of the Gamma distribution. Function GammaIn *)
(* provides the corresponding cumulative incomplete gamma *)
(* probability. *)
(* *)
(* An error in the input arguments results in a returned *)
(* probability of -1. *)
(* *)
(*-------------------------------------------------------------------------*)

CONST
MaxIter = 200;
Dprec = 12;

VAR
Ierr: INTEGER;
Iter: INTEGER;
Cprec: REAL;

BEGIN (* SigChi *)

SigChi := 1.0 - GammaIn( Chisq / 2.0, Df / 2.0, Dprec, MaxIter,
Cprec, Iter, Ierr );

IF ( Ierr <> 0 ) THEN SigChi := -1.0;

END (* SigChi *);


  3 Responses to “Category : Pascal Source Code
Archive   : PIBSIGS.ZIP
Filename : SIGCHI.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/