anova
Analysis of variance (ANOVA).
Installation
$ npm i ml-anova
Usage
One-way ANOVA
import { oneWay } from 'ml-anova';
const data = [6, 8, 4, 5, 3, 4, 8, 12, 9, 11, 6, 8, 13, 9, 11, 8, 7, 12];
const classes = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2];
const result = oneWay(data, classes, { alpha: 0.05 });
Repeated measures ANOVA
import {repeatedMeasures} from 'ml-anova';
const d = [45, 50, 55, 42, 42, 45, 36, 41, 43, 39, 35, 40, 51, 55, 59, 44, 49, 56];
const patients = [1 ,1 ,1 ,2 ,2 ,2 ,3 ,3 ,3 ,4, 4, 4, 5,5 ,5 ,6 ,6 ,6 ];
const time = [
'pre','3month','6months','pre','3month','6months','pre','3month','6months','pre','3month','6months','pre','3month','6months','pre','3month','6months'
];
const result = repeatedMeasures(data, time, patients, { alpha: 0.05 });
Two-way ANOVA
import { twoWay } from 'ml-anova';
const data = [1, 2, 1, 3, 4, 5, 9, 10, 11];
const classesA = ['A', 'A', 'A', 'B', 'B', 'B', 'C', 'C', 'C'];
const classesB = ['X', 'X', 'X', 'X', 'X', 'X', 'Y', 'Y', 'Y'];
const result = twoWay(data, classesA, classesB, { alpha: 0.05 });
License
MIT