Hi the List!

The new orgtbl-fit package has just been released on Melpa. It
does regression fitting on Org Mode tables.

Example. We suspect that `obs' depends on `x' and `y'.

|  x | y |  obs |
|----+---+------|
| 32 | 7 | 38.3 |
| 18 | 3 | 11.4 |
| 43 | 9 | 47.3 |
| 11 | 2 |  8.9 |
| 35 | 8 | 45.1 |

Let us put the cursor on the `obs' column, and type
M-x orgtbl-fit

Two columns are added
- predicted obs column
- difference between obs and predicted

|  x | y |  obs | Best Fit | Fit Diff |
|----+---+------+----------+----------|
| 32 | 7 | 38.3 |     38.2 |     -0.1 |
| 18 | 3 | 11.4 |     11.6 |      0.2 |
| 43 | 9 | 47.3 |     47.2 |     -0.1 |
| 11 | 2 |  8.9 |      8.7 |     -0.2 |
| 35 | 8 | 45.1 |     45.3 |      0.2 |
#+TBLFM: $4=-0.289267886829 - 1.06613976706*$1 + 10.3668885192*$2; %.1f::$5=$4-$3; %.1f

So we discovered that
obs = -0.29 -1.07*x +10.37*y

Behind the scene, the calcFunc-fit function from Emacs-Calc is called.

Install through Melpa:
M-x package-install orgtbl-fit

Source and documentation here:
https://github.com/tbanel/orgtblfit/blob/master/README.org

Have fun
Thierry


Reply via email to