Category : Pascal Source Code
Archive   : PIBSIGS.ZIP
Filename : TESTINVT.PAS
(* TestInvt --- Test inverse chi-square *)
(*--------------------------------------------------------------------------*)
PROGRAM TestInvt;
(*--------------------------------------------------------------------------*)
(* *)
(* Program: TestInvt *)
(* *)
(* Purpose: Demonstrate inverse t routine in PIBSIGS *)
(* *)
(* Usage: This program prompts for a p-value and degrees of freedom. *)
(* It computes and prints the corresponding percentage points *)
(* (one-tailed and two-tailed) of the t distribution. *)
(* *)
(* Note: the input probability is the tail value, not the *)
(* cumulative probability value. *)
(* *)
(* To stop the program, enter a negative p-value. *)
(* *)
(* Calls: Tinv *)
(* *)
(*--------------------------------------------------------------------------*)
VAR
t1: REAL;
t2: REAL;
Df: REAL;
P: REAL;
Done: BOOLEAN;
(*$I SIGCONST.PAS *)
(*$I LOGTEN.PAS *)
(*$I POWTEN.PAS *)
(*$I ALGAMA.PAS *)
(*$I CDBETA.PAS *)
(*$I BETAINV.PAS *)
(*$I SIGT.PAS *)
(*$I TINV.PAS *)
BEGIN (* TestInvt *)
Done := FALSE;
ClrScr;
REPEAT
WRITE('Enter tail probability value and degrees of freedom: ');
READLN( P , Df );
IF ( P > 0.0 ) THEN
BEGIN
t1 := Tinv( P , Df );
t2 := Tinv( P / 2.0 , Df );
WRITELN('One-tailed percentage point = ',t1:12:5);
WRITELN('Two-tailed percentage point = ',t2:12:5);
END
ELSE
Done := TRUE;
UNTIL Done;
END (* TestInvt *).
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/