yat
0.20.3pre
|
one-way ANOVA More...
#include <yat/statistics/Anova.h>
Public Member Functions | |
Anova (size_t n) | |
void | add (double x, size_t g, long int n=1) |
add a data point More... | |
double | F (void) const |
size_t | inter_df (void) const |
size_t | intra_df (void) const |
double | p_value (void) const |
void | reset (void) |
remove all data | |
one-way ANOVA
One-way Analysis of Variance is an extension of a t-test to compare also more than two groups.
theplu::yat::statistics::Anova::Anova | ( | size_t | n | ) |
n | number of groups compared |
void theplu::yat::statistics::Anova::add | ( | double | x, |
size_t | g, | ||
long int | n = 1 |
||
) |
add a data point
x | value of data point |
g | group the data belongs to |
n | number of data points |
double theplu::yat::statistics::Anova::F | ( | void | ) | const |
F is calculated as the ratio between within-group variance and between-group variance.
If null hypothesis is true, F follows an F(a,b) distribution where a is inter_df() and b is intra_df.
size_t theplu::yat::statistics::Anova::inter_df | ( | void | ) | const |
Number of samples minus one.
size_t theplu::yat::statistics::Anova::intra_df | ( | void | ) | const |
Number of groups minus one
double theplu::yat::statistics::Anova::p_value | ( | void | ) | const |
Calculates the probability to get F (or larger) given the null hypothesis that there is no difference between the groups.