CC: | "bug-statistics-test-wilcoxonranksum [...] rt.cpan.org" <bug-statistics-test-wilcoxonranksum [...] rt.cpan.org> |
Subject: | question: if the sign of the Z is defined properly |
Date: | Tue, 24 Nov 2009 10:22:58 -0800 |
To: | "Iingrid.falk [...] loria.fr" <Iingrid.falk [...] loria.fr> |
From: | Alexey Eroshkin <eroshkin [...] burnham.org> |
Hello Ingrid,
I have tried your module Statistics-Test-WilcoxonRankSum-0.0.6 and found it very useful.
One question: if the sign of the Z is defined properly.
I have used your example three times and I have changed the order of datasetsd (1 and 2) have for the two last cases :
Ranks of dataset 1 are lower than expected
Ranks of dataset 1 are higher than expected
Z score was the same - z: -2.283606
Is this is a correct behavior of the program or the sign of Z should change?
Thanks
Alexey
Burnham Instuitute
use Statistics::Test::WilcoxonRankSum;
my $wilcox_test = Statistics::Test::WilcoxonRankSum->new();
my @dataset_1 = (4.6, 4.7, 4.9, 5.1, 5.2, 5.5, 5.8, 6.1, 6.5, 6.5, 7.2);
my @dataset_2 = (5.2, 5.3, 5.4, 5.6, 6.2, 6.3, 6.8, 7.7, 8.0, 8.1);
$wilcox_test->load_data(\@dataset_1, \@dataset_2);
my $prob = $wilcox_test->probability();
my $pf = sprintf '%f', $prob; # prints 0.091022
print $wilcox_test->probability_status();
[root@oneleg Statistics-Test-WilcoxonRankSum-0.0.6]# /home/eroshkin/bin/WilcoxonRankSum.pl
Probability: 0.091022, normal approx w. mean: 121.000000, std deviation: 14.200939, z: -1.690029
prob = 0.091022
----------------------------------------------------------------
dataset | n | rank sum: observed / expected
----------------------------------------------------------------
1 | 11 | 96 / 115
----------------------------------------------------------------
2 | 10 | 134 / 105
----------------------------------------------------------------
N (size of both datasets): 21
Probability: 0.091022, normal approx w. mean: 121.000000, std deviation: 14.200939, z: -1.690029
Not significant (at 0.05 level)
[root@oneleg Statistics-Test-WilcoxonRankSum-0.0.6]# vi /home/eroshkin/bin/WilcoxonRankSum.pl
changed the datasets (added 1,2,3 to #1
my @dataset_1 = (4.6, 4.7, 4.9, 5.1, 5.2, 5.5, 5.8, 6.1, 6.5, 6.5, 7.2,1,2,3);
my @dataset_2 = (5.2, 5.3, 5.4, 5.6, 6.2, 6.3, 6.8, 7.7, 8.0, 8.1);
[root@oneleg Statistics-Test-WilcoxonRankSum-0.0.6]# /home/eroshkin/bin/WilcoxonRankSum.pl
Probability: 0.022394, normal approx w. mean: 175.000000, std deviation: 17.078251, z: -2.283606
prob = 0.022394
----------------------------------------------------------------
dataset | n | rank sum: observed / expected
----------------------------------------------------------------
1 | 14 | 135 / 168
----------------------------------------------------------------
2 | 10 | 164 / 120
----------------------------------------------------------------
N (size of both datasets): 24
Probability: 0.022394, normal approx w. mean: 175.000000, std deviation: 17.078251, z: -2.283606
Significant (at 0.05 level)
Ranks of dataset 1 are lower than expected
[root@oneleg Statistics-Test-WilcoxonRankSum-0.0.6]# vi /home/eroshkin/bin/WilcoxonRankSum.pl
changed the order of datasets:
my @dataset_2 = (4.6, 4.7, 4.9, 5.1, 5.2, 5.5, 5.8, 6.1, 6.5, 6.5, 7.2,1,2,3);
my @dataset_1 = (5.2, 5.3, 5.4, 5.6, 6.2, 6.3, 6.8, 7.7, 8.0, 8.1);
[root@oneleg Statistics-Test-WilcoxonRankSum-0.0.6]# /home/eroshkin/bin/WilcoxonRankSum.pl
Probability: 0.022394, normal approx w. mean: 175.000000, std deviation: 17.078251, z: -2.283606
prob = 0.022394
----------------------------------------------------------------
dataset | n | rank sum: observed / expected
----------------------------------------------------------------
1 | 10 | 164 / 120
----------------------------------------------------------------
2 | 14 | 135 / 168
----------------------------------------------------------------
N (size of both datasets): 24
Probability: 0.022394, normal approx w. mean: 175.000000, std deviation: 17.078251, z: -2.283606
Significant (at 0.05 level)
Ranks of dataset 1 are higher than expected