% Function File: [p, F, df1, df2] = wanova (y, g)
% Perform a Welch's alternative to one-way analysis of variance
% (ANOVA). The goal is to test whether the population means of data
% taken from k different groups are all equal. This test does not
% require the condition of homogeneity of variances be satisfied.
% For post-tests, it is recommended to run the function 'multicmp'.
% Data should be given in a single vector y with groups specified by
% a corresponding vector of group labels g (e.g., numbers from 1 to
% k). This is the general form which does not impose any restriction
% on the number of data in each group or the group labels.
% Under the null of constant means, the Welch's test statistic F
% follows an F distribution with df1 and df2 degrees of freedom.
% The p-value (1 minus the CDF of this distribution at F) is
% returned in the p output variable.
%  Welch (1951) On the Comparison of Several Mean Values: An
% Alternative Approach. Biometrika. 38(3/4):330-336
%  Tomarken and Serlin (1986) Comparison of ANOVA alternatives
% under variance heterogeneity and specific noncentrality
% structures. Psychological Bulletin. 99(1):90-99.