0
votes

I'm using the Perl module of Statistics::Regression. It runs multi-variate regressions fine. However, if I only supply one regressor in the constructor

my $reg = Statistics::Regression->new("Sample Regression", ['X']);

It complains with this message:

Statistics::Regression:new: Cannot run a regression without at least two variables.

Do people have the same problem? The error message is not clearly worded so that I interpreted as if I'm not supplying the response variable. But that turns out not to be the case as based on its doc and some sample scripts I tested on the side, the list reference in the constructor should only include regressors.

IN any case, how do you run a single variable regression (no constant term) using this module? (I know Statistics::OLS can do that but for simplicity I would like this module to work. At any rate, feels like a stupid omission if it truly cannot handle that.) Thx!

1
Given the description says "Regression.pm is a multivariate linear regression package", I don't see how you're going to get it to do univariate regressions.CanSpice
@CanSpice, Ok, fair enough. If you make that as an answer, I'll check you. Thx.Zhang18

1 Answers

2
votes

The module's description reads:

Regression.pm is a multivariate linear regression package.

Given this, it seems unlikely that you'll be able to get it to do univariate regressions.

You could try emailing the author, though. It's been four years since Statistics::Regression was released to CPAN so he might have stopped supporting it (or it's in such a good state that it doesn't need more releases), but it's worth a shot getting his opinion. He might have some idea as to patching it to handle univariate regressions.