An open API service indexing awesome lists of open source software.

https://github.com/doches/ruby-regress

A command-line tool & Ruby class for computing Pearson's r and other stats
https://github.com/doches/ruby-regress

Last synced: over 1 year ago
JSON representation

A command-line tool & Ruby class for computing Pearson's r and other stats

Awesome Lists containing this project

README

          

# ruby-regress
### A partial drop-in replacement for |STAT's regress

`ruby-regress` is a tool for computing correlations and regression equations
from two-variable input. It is designed to function as a drop-in replacement
for Gary Perlman's `regress`, at least for those who use only the basic
functionality that `regress` provides.

## Why!?

The problem with Gary Perlman's excellent |STAT programs is twofold:

+ The only way of obtaining a copy is by emailing Perlman and asking for it.
+ The distribution of modified copies is [expressely forbidden](http://oldwww.acm.org/perlman/stat/history.html#conditions).

If you need bulletproof robustness you're probably better off dealing with Perlman's terms of access and using |STAT; if you want ease of installation, try `ruby-regress`.
## Installation

#### From rubygems

If you're using Gemcutter.org as a your gem host (hint: you almost certainly are) you can
install ruby-regress using rubygems:

gem install ruby-regress

which installs the `regress` executable.

#### From source

Download the most recent source from Github:

git clone git://github.com/doches/ruby-regress.git

then build and install the gem:

cd ruby-regress
rake build
sudo rake install

## Usage

ruby-regress installs a single command line tool called `regress`, which
reads from `STDIN` and prints a report containing the correlation coefficient,
plus some descriptive statistics, to `STDOUT`. For example, if we have a file in
the current directory called `data.txt` containing two datasets:

1 12.0
2 11.0
3 13.0
4 14.0

we can get the correlation coefficient between these two variables by:

cat data.txt | regress

which will dump a load of statistical information about the datasets to
the terminal.