NAME
Statistics::ANOVA::Friedman - nonparametric repeated measures analysis of variance for nominal variables (Friedman Test)
VERSION
This is documentation for version 0.01, released February 2015.
SYNOPSIS
use Statistics::ANOVA::Friedman;
my $fried = Statistics::ANOVA::Friedman->new();
my ($chi_value, $df, $count, $p_value) = $fried->chiprob_test(data => HOA);
$fried->load({1 => [2, 4, 6], 2 => [3, 3, 12], 3 => [5, 7, 11]}); # or pre-load with HOA
($chi_value, $df, $count, $p_value) = $fried->chiprob_test();
my ($f_value, $df_b, $df_w, $p_value2) = $fried->fprob_test();
DESCRIPTION
Performs the Friedman nonparametric analysis of variance - for two or more dependent (matched, related) nominal variables. A ranking procedure is used, but, unlike the case for independent variables, the ranks are taken at each common index of each variable, i.e., within-groups, given that values at each index are given by the same data-source (person, plot, etc.).
By default, the method accounts for and corrects for ties, but if correct_ties => 0, the test-statistic is uncorrected. The correction involves accounting for the number of tied variables at each index, as per Hollander & Wolfe (1995), Eq. 7.8, p. 274.
The module uses Statistics::Data as a base so that data can be pre-loaded and otherwise manipulated/queried per that module's methods.
Correctness of output is tested on installation using example data from Hollander & Wolfe (1999, p. 274ff), Rice (1995, p. 470), Sarantakos (1993, p. 404-405), and Siegal (1956, p. 167ff); tests fail if the published chi-values and degrees-of-freedom are not returned by the module.
SUBROUTINES/METHODS
chiprob_test
($chi_value, $df, $count, $p_value) = $fried->chiprob_test(data => HOA, correct_ties => 1);
Performs the ANOVA and returns the chi-square value, its degrees-of-freedom, the total number of observations, and associated probability value (or only the latter if called in scalar context). Default value of optional argument correct_ties is 1.
chiprob_str
$str = $fried->chiprob_str(data => HOA, correct_ties => 1);
Performs the same test as for chiprob_test but returns not an array but a string of the conventional reporting form, e.g., chi^2(df, N = total observations) = chi_value, p = p_value.
fprob_test
($f_value, $df_b, $df_w, $p_value) = $fried->fprob_test(data => HOA);
$p_value = $fried->fprob_test(data => HOA);
Performs the same test as above but transforms the chi-value into an F-distributed value, returning this F-equivalent value, between and within groups degrees-of-freedom, and then the associated probability off the F-distribution (or only the latter if called in scalar context). Default value of optional argument correct_ties is 1. This method has not been tested against sample data as yet.
fprob_str
$str = $fried->chiprob_str(data => HOA, correct_ties => 1);
Performs the same test as for fprob_test but returns not an array but a string of the conventional reporting form, e.g., F(df_b, df_w) = f_value, p = p_value.
DEPENDENCIES
List::AllUtils : used for summing.
Math::Cephes : used for probability functions.
Statistics::Data : used as base.
Statistics::Data::Rank : used to calculate the dependent sum-square of ranks. See this module for retrieving the actual arrays of ranks and sum-squares.
DIAGNOSTICS
- Need to have equal numbers of observations greater than 1 per two or variables for chiprob_test
-
croak
ed if there are not equal numbers of numerical values in each given variable, and if there are not at least two variables. Similarly for fprob_test.
REFERENCES
Hollander, M., & Wolfe, D. A. (1999). Nonparametric statistical methods. New York, NY, US: Wiley.
Rice, J. A. (1995). Mathematical statistics and data analysis. Belmont, CA, US: Duxbury.
Sarantakos, S. (1993). Social research. Melbourne, Australia: MacMillan.
Siegal, S. (1956). Nonparametric statistics for the behavioral sciences. New York, NY, US: McGraw-Hill
AUTHOR
Roderick Garton, <rgarton at cpan.org>
BUGS
Please report any bugs or feature requests to bug-statistics-anova-friedman-0.01 at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Statistics-ANOVA-Friedman-0.01. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Statistics::ANOVA::Friedman
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Statistics-ANOVA-Friedman-0.01
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
http://cpanratings.perl.org/d/Statistics-ANOVA-Friedman-0.01
Search CPAN
LICENSE AND COPYRIGHT
Copyright 2015 Roderick Garton.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.