Skip Menu |

This queue is for tickets about the Statistics-Descriptive CPAN distribution.

Report information
The Basics
Id: 41863
Status: rejected
Priority: 0/
Queue: Statistics-Descriptive

People
Owner: Nobody in particular
Requestors: P.Caffin [...] curtin.edu.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: median() in Statistics::Descriptive Perl module
Date: Mon, 22 Dec 2008 16:57:57 +0900
To: <bug-Statistics-Descriptive [...] rt.cpan.org>
From: "Peter Caffin" <P.Caffin [...] curtin.edu.au>
Show quoted text
> I'm using your Statistics::Descriptive Perl module but running into > problems trying to retrieve the median for my data. > > The code that's causing the error: > > # Output stats > my $mean = $stat->mean(); > my $mdn = $stat->median(); > my $max = $stat->max(); > > The error: Can't access `median' field in class > Statistics::Descriptive::Sparse > > Commenting out the median line, no errors appear and I get appropriate > stats for max and mean. > > Perl is v5.8.3 built for i586-linux-thread-multi. > Statistics::Descriptive is current as refreshed from CPAN today > (v2.6). >
Hi Mr. Caffin! This is not a bug. See below. On Mon Dec 22 02:59:27 2008, P.Caffin@curtin.edu.au wrote: Show quoted text
> > I'm using your Statistics::Descriptive Perl module but running into > > problems trying to retrieve the median for my data. > > > > The code that's causing the error: > > > > # Output stats > > my $mean = $stat->mean(); > > my $mdn = $stat->median(); > > my $max = $stat->max(); > > > > The error: Can't access `median' field in class > > Statistics::Descriptive::Sparse > >
Your problem is that you were using Statistics::Descriptive::Sparse (which has no ->median() support) instead of S::D::Full. If you use S::D::Full instead, you'll get ->median() (while retaining full compatibility with S::D::Sparse). Show quoted text
> > Commenting out the median line, no errors appear and I get appropriate > > stats for max and mean. > > > > Perl is v5.8.3 built for i586-linux-thread-multi. > > Statistics::Descriptive is current as refreshed from CPAN today > > (v2.6). > >
Regards, -- Shlomi Fish
Rejecting because it's not a bug. See my comment above. Regards, -- Shlomi Fish