The typical way to get the p-value for a one-way anova is
anova(lm(y~g))
. This function was written to add two new features.
First, using the method of Brown and Forsythe (1974a), the function allows for non-equal variances between the groups. This is one generalization of Welch's t-test to the one-way ANOVA case. Brown and Forsythe (1974b) give simulations showing
that the type I error rate is close to the nominal (under the nomrality assumption with different variances).
Second, the function gives confidence intervals on either 'ICC' or 'varb'.
The 'varb' (the between-group variance) is sum((na/n)*(ua-u)^2)
where na is a vector of length k giving the sample size in each group, n is the total sample size, and ua is a vector of the k means in the groups, and u is the overall mean. Let varw be the within-group variance, then ICC=varb/(varb+varw).
ICC is the intraclass correlation coefficient, and in this situation it is the
parameter that the R square is estimating.