[Bio] / FigKernelPackages / gjostat.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/gjostat.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Mon Jan 18 19:52:18 2010 UTC revision 1.2, Sun Aug 15 20:14:59 2010 UTC
# Line 1  Line 1 
1  package gjostat;  package gjostat;
2    
 #  perl functions for dealing with statistics  
 #  
 #  Note:  Exponentiation by int uses **.  
 #         Should consider explicit multiplication  
 #  
 #         No checking for integer values is performed  
 #  
 #  Usage:  
 #  
 #     use  gjostat;  
 #  
 #  
 #  $var = rand_normal()  
 #  
 #  $mean = mean( @x )  
 #  ( $mean, $stdev ) = mean_stddev( @x )  
 #  $cc = correl_coef( \@x, \@y )  
 #  $cc = correl_coef_z_val( $cc, $n_samples )  
 #  
 #  $median = general_median( $fraction, @list )  
 #  
 #  ( $chi_sqr, $df, $n ) = chi_square(  \@expected, \@observed )  
 #  ( $chi_sqr, $df, $n ) = contingency_chi_sqr(  @row_refs )  
 #  ( $chi_sqr, $df, $n ) = contingency_chi_sqr( \@row_refs )  
 #  ( $chi_sqr, $df, $n ) = contingency_chi_sqr_2( \@row1, \@row2 )  
 #  ( $chi_sqr, $df, $n ) = contingency_chi_sqr_2( \@row_refs )  
 #  
 #  $p_value = chisqr_prob( $chisqr, $df )  
 #  $chisqr  = chisqr_critical_value( $p_value, $df )  
 #  
 #  $coef = binomial_coef( $n, $m )  
 #  $prob = binomial_prob_eq_m( $n, $m, $p )  
 #  $prob = binomial_prob_le_m( $n, $m, $p )  
 #  $prob = binomial_prob_ge_m( $n, $m, $p )  
 #  
 #  $ln_coef = ln_binomial_coef( $n, $m )  
 #  $ln_prob = ln_binomial_prob_eq_m( $n, $m, $p )  
 #  
 #  $m = binomial_critical_value_m_ge( $n, $p, $P )  
 #  $m = binomial_critical_value_m_le( $n, $p, $P )  
 #  
 #  $prob = std_normal_ge_z( $z )  
 #  $prob = std_normal_le_z( $z )  
 #  
 #  $z = std_normal_critical_value_z_ge( $P )  
 #  $z = std_normal_critical_value_z_le( $P )  
 #  
 #  $prob = poisson_prob_eq_n( $n, $mu )  
 #  $prob = poisson_prob_le_n( $n, $mu )  
 #  $prob = poisson_prob_ge_n( $n, $mu )  
 #  
 #  $fact    = factorial( $n )  
 #  $ln_fact = ln_factorial( $n )  
   
3  use strict;  use strict;
4    
5    sub usage
6    {
7    <<'End_of_Usage';
8    gjostat.pm - perl functions for dealing with statistics
9    
10    $var = rand_normal()
11    
12    $mean = mean( @x )
13    ( $mean, $stdev ) = mean_stddev( @x )
14    $cc = correl_coef( \@x, \@y )
15    $cc = correl_coef_z_val( $cc, $n_samples )
16    
17    $median = general_median( $fraction, @list )
18    
19    ( $chi_sqr, $df, $n ) = chi_square( \@expected, \@observed )
20    ( $chi_sqr, $df, $n ) = contingency_chi_sqr(  @row_refs )
21    ( $chi_sqr, $df, $n ) = contingency_chi_sqr( \@row_refs )
22    ( $chi_sqr, $df, $n ) = contingency_chi_sqr_2( \@row1, \@row2 )
23    ( $chi_sqr, $df, $n ) = contingency_chi_sqr_2( \@row_refs )
24    
25    $p_value = chisqr_prob( $chisqr, $df )
26    $chisqr  = chisqr_critical_value( $p_value, $df )
27    
28    $coef = binomial_coef( $n, $m )
29    $prob = binomial_prob_eq_m( $n, $m, $p )
30    $prob = binomial_prob_le_m( $n, $m, $p )
31    $prob = binomial_prob_ge_m( $n, $m, $p )
32    
33    $ln_coef = ln_binomial_coef( $n, $m )
34    $ln_prob = ln_binomial_prob_eq_m( $n, $m, $p )
35    
36    $m = binomial_critical_value_m_ge( $n, $p, $P )
37    $m = binomial_critical_value_m_le( $n, $p, $P )
38    
39    $prob = std_normal_ge_z( $z )
40    $prob = std_normal_le_z( $z )
41    
42    $z = std_normal_critical_value_z_ge( $P )
43    $z = std_normal_critical_value_z_le( $P )
44    
45    $prob = poisson_prob_eq_n( $n, $mu )
46    $prob = poisson_prob_le_n( $n, $mu )
47    $prob = poisson_prob_ge_n( $n, $mu )
48    
49    $fact    = factorial( $n )
50    $ln_fact = ln_factorial( $n )
51    
52    Notes:  Exponentiation by int uses **.
53            Should consider explicit multiplication
54    
55            No checking for integer values is performed
56    End_of_Usage
57    }
58    
59    
60  require Exporter;  require Exporter;
61    
62  our @ISA = qw(Exporter);  our @ISA = qw(Exporter);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3