index.js (2110B)
1 /** 2 * @license Apache-2.0 3 * 4 * Copyright (c) 2018 The Stdlib Authors. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 'use strict'; 20 21 /** 22 * One-way analysis of variance. 23 * 24 * @module @stdlib/stats/anova1 25 * 26 * @example 27 * var anova1 = require( '@stdlib/stats/anova1' ); 28 * var x = [ 1, 3, 5, 2, 4, 6, 8, 7, 10, 11, 12, 15 ]; 29 * var f = [ 'control', 'treatA', 'treatB', 'treatC', 'control', 'treatA', 'treatB', 'treatC', 'control', 'treatA', 'treatB', 'treatC' ]; 30 * 31 * var out = anova1( x, f ); 32 * /* returns 33 * { 34 * 'treatment': { 35 * 'df': 3, 36 * 'ss': ~20.667, 37 * 'ms': ~6.889 38 * } 39 * 'error': { 40 * 'df': 8, 41 * 'ss': ~185.333, 42 * 'ms': ~23.1667, 43 * }, 44 * 'statistic': ~0.297, 45 * 'pValue': ~0.826, 46 * 'means': { 'control': { 'mean': 5.0, 'sampleSize': 3, 'SD': ~4.583 }, 47 * 'treatA': { 'mean': ~6.667, 'sampleSize': 3, 'SD': ~4.041 }, 48 * 'treatB': { 'mean': ~8.333, 'sampleSize': 3, 'SD': ~3.512 }, 49 * 'treatC': { 'mean': 8.0, 'sampleSize': 3, 'SD': ~6.557 } 50 * }, 51 * 'method': 'One-Way ANOVA' 52 * } 53 * *\/ 54 * 55 * var table = out.print(); 56 * /* 57 * One-Way ANOVA 58 * 59 * Null Hypothesis: All Means Equal 60 * Alternate Hypothesis: At Least one Mean not Equal 61 * 62 * df SS MS F Score P Value 63 * Treatment 3 20.6667 6.8889 0.2974 0.8265 64 * Errors 8 185.3333 23.1667 65 * 66 * Fail to Reject Null: 0.8265 >= 0.05 67 * 68 * *\/ 69 */ 70 71 // MODULES // 72 73 var anova1 = require( './anova1.js' ); 74 75 76 // EXPORTS // 77 78 module.exports = anova1;