//////////////////////////////////////////////////////////////// // // StudentTTable.q // //////////////////////////////////////////////////////////////// (Def (StudentTTable numin numax ps) //////////////////////////////////////////////////////////////// // Input: // numin = min nu along vertical, e.g. 1 // numax = max nu along vertical, e.g. 100 // ps = probability levels in [0.,1.] along horizontal // e.g. [.9 .95 .975 .99 .995 .999] // Output: // Print a StudentT table similar to the table found at // http://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm // OR https://en.wikipedia.org/wiki/Student%27s_t-distribution //////////////////////////////////////////////////////////////// (Local p f) (WithPrecision 100 (Write "nu\\p ") (Loop (In p ps) (Do (Write " {0:g-8}" p))) (WriteLine) (Loop (To nu numin numax) (Do (Write "{0:g3} " nu) (Loop (In p ps) (Do (Setq f (StudentTQuant nu p)) (Write " {0:g#9}" f))) (WriteLine)))) ) (Def (StudentTTableTest) // NIST's Table //(StudentTTable 1 100 [.9 .95 .975 .99 .995 .999]) // wikipedia's Table //(StudentTTable 1 120 [.75 .8 .85 .90 .95 .975 .99 .995 .9975 .999 .9995]) // Our Table (StudentTTable 1 100 [.9 .95 .975 .99 .995 .9975 .999 .9995 .99975 .9999]) )