NAME
Statistics::Deviation - Basic ztest and normal probability reporting
VERSION
This is documentation for Version 0.01 of Statistics::Deviation (2006.11.22).
SYNOPSIS
use Statistics::Deviation;
my $dev = Statistics::Deviation->new(
ccorr => 1,
tails => 2,
s_precision => 5,
p_precision => 5,
);
my ($z, $pz, $observed_deviation, $standard_deviation) =
$dev->ztest(
observed => $stat_obs,
expected => $stat_exp,
variance => $variance,
);
DESCRIPTION
Calculates a z-statistic: the ratio of an observed deviation to a standard deviation. Purpose is simply to support Statistics::Sequences, but with some standalone utilities.
METHODS
new
$dev = Statistics::Deviation->new();
Returns a Statistics::Deviation object. Accepts setting of any of the OPTIONS.
ztest
You supply the observed and expected values of your statistic, and the variance (observed or expected).
Additionally, you may specify a boolean for performing the continuity-correction to the observed deviation, and then a value of either 1 or 2 to specify the tails relevant to determining the probability of obtaining the calculated z.
Returns an array consisting of the z-statistic, its probability, the observed deviation (the difference between the observed and expected values of your statistic), and the standard deviation (the square-root of the variance supplied).
All return a z_value, or a z_value and p_value, where relevant, and called in array context.
p_value
$p = $dev->p_value($z)
Send a z-value, get its associated p-value, 2-tailed by default.
r_2_z
$z = $dev->r_2_z($r)
Performs the Fisher r-to-z transformation. Send a correlation coefficient - get back a z-value.
z_2_r
$r = $dev->z_2_r($z)
Send a z-value - get back a correlation coefficient.
chi_2_z
$z = $dev->chi_2_z($chi)
Send a chi-value, get back a z-value (the square-root of the thing ...).
dep_intercorrelation
($z, $p) = $dev->dep_intercorrelation($r_xz, $r_yz, $r_xy, $n)
For comparing dependent correlations with a common variable. You have the r-values for the correlation between (1) Variable X and Variable Z, and Variable Y and Variable Z, and want to test, for example, if Z correlates more highly with X than with Y. These two correlations form the first two arguments (after the class object). You also need to calculate the correlation of X and Y themselves, and send it as the third argument. Lastly, also send the sample size. Uses the Meng-Rosenthal-Rubin method.
OPTIONS
The following can be set in the call to new or test.
observed
The observed value of the test statistic.
expected
The expected value of the test statistic.
variance
The variance of the test statistic (whether expected or observed).
ccorr
Apply the continuity correction. Default = 0.
s_precision
Precision of the z_value. Default = 2.
p_precision
Precision of the associated p_value. Default = 0.
tails
Tails from which to assess the association p_value (1 or 2). Default = 2.
SEE ALSO
Statistics::Distributions : the uprob
and precision_string
methods are here used for calculating and reporting probability.
TO DO/BUGS
Other distributions.
AUTHOR
Roderick Garton, <rgarton@utas_DOT_edu_DOT_au>
COPYRIGHT/LICENSE/DISCLAIMER
Copyright (C) 2007 Roderick Garton
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To the maximum extent permitted by applicable law, the author of this module disclaims all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with regard to the software and the accompanying documentation.