The one-way ANOVA (Analysis of Variance) tests whether three or more population means are equal.
The null hypothesis and alternative hypothesis are defined as: : , and : At least one differs from the others.
The data is passed to the procedure as a rank-2 array x
, where each column is a group of observations.
The procedure partitions then the total variability in the data ( ) into
variability between groups ( ; variability explained by groups ), and
variability within groups ( ; unexplained or residual variability ), so that
The F-statistic (f
) is the ratio of the mean sum of squares between groups
to the mean sum of squares within groups:
where is the number of groups, is the total number of observations,
is the sum of squares between groups, and
is the sum of squares within groups.
The degrees of freedom are between groups (df_b
)
and within groups (df_w
).
The resulting p-value (p
) is computed from the F-distribution:
It is computed with the elemental procedure f_dst_f_cdf_core
.
The ANOVA makes the assumptions that a) the groups are independent, b) the observations within each group are normally distributed, and c) The variances within groups are equal.
Impure wrapper procedure for s_tst_anova_1w_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:,:) |
2D array, each column is a group |
||
real(kind=wp), | intent(out) | :: | f |
F-statistic |
||
real(kind=wp), | intent(out) | :: | df_b |
degrees of freedom between groups |
||
real(kind=wp), | intent(out) | :: | df_w |
degrees of freedom within groups |
||
real(kind=wp), | intent(out) | :: | p |
p-value from F distribution |