home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / USCX / TURBO-11.ZIP / TESTINVT.PAS < prev    next >
Pascal/Delphi Source File  |  1985-05-17  |  3KB  |  65 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*                 TestInvt --- Test inverse chi-square                     *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROGRAM TestInvt;
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*   Program:  TestInvt                                                     *)
  10. (*                                                                          *)
  11. (*   Purpose:  Demonstrate inverse t routine in PIBSIGS                     *)
  12. (*                                                                          *)
  13. (*   Usage:    This program prompts for a p-value and degrees of freedom.   *)
  14. (*             It computes and prints the corresponding percentage points   *)
  15. (*             (one-tailed and two-tailed) of the t distribution.           *)
  16. (*                                                                          *)
  17. (*             Note:  the input probability is the tail value, not the      *)
  18. (*                    cumulative probability value.                         *)
  19. (*                                                                          *)
  20. (*             To stop the program, enter a negative p-value.               *)
  21. (*                                                                          *)
  22. (*   Calls:    Tinv                                                         *)
  23. (*                                                                          *)
  24. (*--------------------------------------------------------------------------*)
  25.  
  26. VAR
  27.    t1:       REAL;
  28.    t2:       REAL;
  29.    Df:       REAL;
  30.    P:        REAL;
  31.    Done:     BOOLEAN;
  32.  
  33. (*$I SIGCONST.PAS *)
  34. (*$I LOGTEN.PAS   *)
  35. (*$I POWTEN.PAS   *)
  36. (*$I ALGAMA.PAS   *)
  37. (*$I CDBETA.PAS   *)
  38. (*$I BETAINV.PAS  *)
  39. (*$I SIGT.PAS     *)
  40. (*$I TINV.PAS     *)
  41.  
  42. BEGIN (* TestInvt *)
  43.  
  44.    Done := FALSE;
  45.    ClrScr;
  46.  
  47.    REPEAT
  48.  
  49.       WRITE('Enter tail probability value and degrees of freedom: ');
  50.       READLN( P , Df );
  51.  
  52.       IF ( P > 0.0 ) THEN
  53.          BEGIN
  54.             t1     := Tinv( P , Df );
  55.             t2     := Tinv( P / 2.0 , Df );
  56.             WRITELN('One-tailed percentage point = ',t1:12:5);
  57.             WRITELN('Two-tailed percentage point = ',t2:12:5);
  58.          END
  59.       ELSE
  60.          Done := TRUE;
  61.  
  62.    UNTIL Done;
  63.  
  64.  
  65. END   (* TestInvt *).