From expected value of R2 in Regression to expected value of partial eta squared in ANOVA

In general, $R^2$, the estimator of "multiple correlation coefficient" in regression, is known to be positively biased. Given $K$ predictors, and $N$ total sample size, Johnson, Kotz, & Balakrishnan, 1995, Vol. 2, p. 621, provide the correct expected value of $R^2$ as follows (Equation 1):

where $P^2$ is the population value of $R^2$, and $H$ is the hypergeometric function.

The distribution of $R^2$ is also known to be a non-central $F$ distribution with $K = df1$, $N - K - 1 = df2$, and the non-centrality parameter ($ncp$) of $(N \times R^2) / (1 - R^2)$.

Question:

Partial eta-squared $(\eta_p^2)$ in ANOVA is exactly distributed like $R^2$ except that $K -1 = df1$, $N - K = df2$, and the non-centrality parameter ($ncp$) of $(N \times \eta_p^2) / (1 - \eta_p^2)$.

My question is, is it possible to re-express the Equation 1 for partial eta-Squared?

Below, I'm showing an R implementation of Equation 1 for $R^2$ which I hope to be able modify to work for partial eta-Squared (I appreciate a possible R implementation).

library(gsl) # used for hypergeometric function

expected.R2 <- function(P2, K, N) {
Value <- 1 - ((N - K - 1)/(N - 1)) * (1 - P2) *
gsl::hyperg_2F1(1, 1, 0.5 * (N + 1), P2)
Value <- max(0, Value)
return(Value)
}
# Example of use:
expected.R2(P2 = .2, K = 2, N = 120)

• The equation remains the same, only the values of df1 and df2 and $P^2$ change. Instead of K you now have K-1 and instead of N-K-1 you now have N-K and lastly instead of P^2 you now have the Population value for the partial-eta squared – Onyambu Jul 12 '18 at 21:32
• The answer is exactly what you have above. The code that you wrote is the answer. The difference is the input values – Onyambu Jul 12 '18 at 22:43
• Just rewrite the above function using the degrees of freedom ie where there is k-1 replace with df1 and where there is N-K-1 replace with df2 then you will see what I mean – Onyambu Jul 12 '18 at 22:51
• imagine i give you have pf(q,df1=k,df2=n-k-1,cpn=..) you will change it to pf(q,df1=k-1,df2=n-k-1,ncp=..) did the underlying equation change?? it did not. It remained the same. The input values changed. Thats what i mean. You just need to modify the inputs and retain the equation or vice versa – Onyambu Jul 12 '18 at 23:06
• thus using your R equation above, add 1 to the input of k – Onyambu Jul 12 '18 at 23:08

Here you have a degrees of freedom issue:

we can rerwite:

\begin{aligned} &1-\frac{N-K-1}{N-1}(1-p^2)H[1;1;\frac{N+1}{2};P^2]\\ &1-\frac{N-df1-1}{N-1}(1-\eta^2)H[1;1;\frac{N+1}{2};\eta^2]\quad\text{Changed } K \text{ to } df1\\ &1-\frac{N-(K-1)-1}{N-1}(1-\eta^2)H[1;1;\frac{N+1}{2};\eta^2]\\ &1-\frac{N-K}{N-1}(1-\eta^2)H[1;1;\frac{N+1}{2};\eta^2] \end{aligned}

library(gsl) # used for hypergeometric function

expected.R2 <- function(P2, K, N) {
Value <- 1 - ((N - K - 1)/(N - 1)) * (1 - P2) *
gsl::hyperg_2F1(1, 1, 0.5 * (N + 1), P2)
Value <- max(0, Value)
return(Value)
}
# Example of use:
expected.R2(P2 = .2, K = 2+1, N = 120)


or:

library(gsl) # used for hypergeometric function

expected.R2 <- function(P2, K, N) {
Value <- 1 - ((N - K)/(N - 1)) * (1 - P2) *
gsl::hyperg_2F1(1, 1, 0.5 * (N + 1), P2)
Value <- max(0, Value)
return(Value)
}
# Example of use:
expected.R2(P2 = .2, K = 2, N = 120)

• Thank you so much for your help. As $\eta_p^2$ and $R^2$ each come with their own unique $df1$, no change to my Equation 1 was needed. – rnorouzian Jul 12 '18 at 23:46