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)
pf(q,df1=k,df2=n-k-1,cpn=..)
you will change it topf(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 $\endgroup$