Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Don't ask to ask, just ask
 
PerlMonks  

Re: strange collision when calculating p-values using Statistics::TTest

by zentara (Archbishop)
on Jun 23, 2012 at 18:35 UTC ( #977999=note: print w/ replies, xml ) Need Help??


in reply to strange collision when calculating p-values using Statistics::TTest

Aside from the possibility that there is a bug in the Statistics::TTest module, my first observation would be that Statistics::TTest leaves behind some leftover junk possibly by using globals within the module. There is a faq for this, read perldoc -q clear where MJD shows how to clear out all temporary package variables.

Usually a module's author will typically stick to using an array or hash for storage in the module. MJD's scrubber gets them all, but you may only need something like this at the end of your loop, to undef your temp arrays.

foreach my $dataset (sort keys %datasets) { my $ttest = new Statistics::TTest; $ttest->load_data(\@{$datasets{$dataset}[0]},\@{$datasets{$dataset +}[1]}); print "$dataset - t_prob:\t$ttest->{t_prob}\n\n"; undef @$ttest; # clear out old array data undef %$ttest; # get old hash data }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: strange collision when calculating p-values using Statistics::TTest
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://977999]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2013-06-19 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many continents have you visited?









    Results (675 votes), past polls