#!/usr/bin/perl -w # # t_distribution # Copyright (C) 2006 by John Heidemann # $Id: t_distribution,v 1.1 2006/08/25 05:11:38 johnh Exp $ # # This program is distributed under terms of the GNU general # public license, version 2. See the file COPYING # in $dblibdir for details. # sub usage { print <getopt) { $ch = $dbopts->opt; if ($ch eq 'c') { $conf_pct = $dbopts->optarg; } else { &usage; }; }; &usage if ($#ARGV != 0); my($n) = $ARGV[0]; # no standard jdb header or trailer my $alpha = 1.0 - $conf_pct; my $conf_alpha = (1.0 - $conf_pct) / 2.0; my $t = &DbTDistr::t_distribution($n - 1, $conf_alpha); printf "confidence_percent: %s\nn: %d\nalpha: %f\ndf: %d\nt(alpha,df): %.6f\n", $conf_pct, $n, $alpha, $n-1, $t; exit 0;