Author image Takeshi Miki

NAME

Statistics::Zscore - Simple scoring module that uses statistics STANDARD SCORE.

SYNOPSIS

  use Statistics::Zscore;
  
  my $z = Statistics::Zscore->new;
  
  # This module calculates statistics STANDARD SCORE that is called 'z-score'. 
  # It returns array reference of z-score.

  my $zscore = $z->standardize( \@array );


  # Furthermore, you can use combine method to get a score 
  # which is a linear combination value of some z-scores with arbitrary weight set.
  # It returns hash reference.

  my $result = $z->combine(
      {
          data => {
              yamada => [ 95, 33, 65, 84 ],
              suzuki => [ 75, 45, 80, 78 ],
              tanaka => [ 44, 72, 84, 65 ],
          },
          weight => [ 0.25, 0.25, 0.4, 0.1 ],
          data_num => 4
      }
  );

DESCRIPTION

Statistics::Zscore is scoring module that uses statistics STANDARD SCORE.

  In statistics, a standard score is a dimensionless quantity 
  derived by subtracting the population mean from an individual raw score 
  and then dividing the difference by the population standard deviation. 
  This conversion process is called standardizing or normalizing.

  Standard scores are also called z-values, z-scores, normal scores, 
  and standardized variables.

--from wiki pedia ( http://en.wikipedia.org/wiki/Standard_score )

METHOD

new()

  constructor.

standardize(\@array, {...opitons...})

  Receives array reference, and returns z-score's array refernce.
  {...options...} are 'scale', 'plus' and 'decimal'.
  (Defaults are scale => 1, plus => 0 and decimal => undef )

   it work inside..
      score = (value - mean) / stddev * scale + plus 
      score = sprintf( decimal, score);

combine(\%hash)

  Receives hash reference, and returns z-score's hash refernce.
  %hash includes 'scale', 'plus' and decimal options.(see above)

AUTHOR

takeshi miki <miki@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO