Win has asked for the wisdom of the Perl Monks concerning the following question:
Gives me the following output:sub correlation { print "I am in the correlation subroutine"; my ($x_ref, $y_ref) = @_; print "\nWe are in the correlation subroutine\n\n"; # print Dumper ($x_ref, $y_ref); print Dumper length($x_ref); print Dumper length($y_ref); my $lfit = Statistics::LineFit->new(); $lfit->setData($x_ref, $y_ref); my ($intercept, $slope) = $lfit->coefficients(); my $rSquared = $lfit->rSquared();
Why does it tell me 'that the Length of x and y arrays must be equal' when we know that the lengths are equal. ($VAR1 = 16; $VAR1 = 16;) -- see output.I am in the correlation subroutine We are in the correlation subroutine $VAR1 = 16; $VAR1 = 16; Length of x and y arrays must be equal! at rebuild.pl line 335 No valid data input - can't do regression at rebuild.pl line 337 No valid data input - can't do regression at rebuild.pl line 338
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Correlation using Statistics::LineFit
by johngg (Canon) on Dec 03, 2007 at 12:00 UTC | |
|
Re: Correlation using Statistics::LineFit -- DISREGARD POST
by blazar (Canon) on Dec 03, 2007 at 16:46 UTC | |
by tye (Sage) on Dec 03, 2007 at 19:48 UTC | |
by blazar (Canon) on Dec 04, 2007 at 00:08 UTC | |
by tye (Sage) on Dec 04, 2007 at 02:23 UTC |