Skip to contents

Computes the point estimate and an exact, noncentrality-based confidence interval for the population partial eta squared (\(\eta^2_p\)). Accepts either the raw ANOVA summary (F, effect df, error df, total N) or a fitted aov/lm/aovlist object, in which case the function returns one row per effect (with stratum identification for within-subjects fits).

Usage

ci_eta_squared_partial(
  object = NULL,
  F_value = NULL,
  df_effect = NULL,
  df_error = NULL,
  N = NULL,
  conf_level = 0.95,
  alpha_lower = NULL,
  alpha_upper = NULL
)

Arguments

object

Optional. A fitted model object of class aov, lm, or aovlist.

F_value

Observed F-value (ignored if object is supplied).

df_effect

Numerator degrees of freedom for the effect (ignored if object is supplied).

df_error

Error (residual) degrees of freedom (ignored if object is supplied).

N

Total sample size (ignored if object is supplied).

conf_level

Desired confidence coverage; default 0.95.

alpha_lower, alpha_upper

Optional Type I error on the lower and upper side.

Value

A data.frame with one row per effect. Single-stratum fits and the raw interface return columns effect, eta_squared_partial, lower_limit, upper_limit, F_value, df_effect, df_error, N. aovlist fits additionally include a stratum column. With the raw-argument interface effect is "overall".

Details

This is the explicitly-named counterpart of ci_eta_squared. The two share point-estimate and CI machinery: in a one-way ANOVA partial \(\eta^2\) coincides with \(\eta^2\); in a factorial or within-subjects ANOVA both functions return the per-effect partial value computed against that effect's own error stratum. Use ci_eta_squared_partial when you want the function name to make the partial interpretation explicit.

References

Cohen, J. (1973). Eta-squared and partial eta-squared in fixed factor ANOVA designs. Educational and Psychological Measurement, 33(1), 107–112.

Kelley, K. (2007). Confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20(8), 1–24. doi:10.18637/jss.v020.i08

Kelley, K., & Preacher, K. J. (2012). On effect size. Psychological Methods, 17, 137–152. doi:10.1037/a0028086

Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge. (See Chapter 3 on \(\eta^2\), Chapter 7 on factorial designs, and Chapter 11 on generalized \(\eta^2\) for within-subjects designs.)

Smithson, M. (2001). Correct confidence intervals for various regression effect sizes and parameters: The importance of noncentral distributions in computing intervals. Educational and Psychological Measurement, 61, 605–632. doi:10.1177/00131640121971392

Steiger, J. H. (2004). Beyond the F test: Effect size confidence intervals and tests of close fit in the analysis of variance and contrast analysis. Psychological Methods, 9(2), 164–182. doi:10.1037/1082-989X.9.2.164

Author

Ken Kelley kkelley@nd.edu

Examples

# Raw-argument interface.
ci_eta_squared_partial(F_value = 11.221, df_effect = 4,
                       df_error = 50, N = 55)
#>  effect  eta_squared_partial lower_limit upper_limit F_value df_effect df_error
#>  overall 0.473               0.226       0.587       11.2    4         50      
#>  N 
#>  55

# Two-factor ANOVA: per-effect partial eta squared with CI for the
# manipulated expectancy treatment and the measured grade
# classification (pygmalion data, N = 310). The treatment by grade
# interaction is weak here (F = 1.19), so the additive model is used.
fit <- aov(iq_8 ~ treatment + factor(grade), data = pygmalion)
ci_eta_squared_partial(fit)
#>  effect        eta_squared_partial lower_limit upper_limit F_value df_effect
#>  treatment     0.0211              0.00102     0.0619      6.52    1        
#>  factor(grade) 0.044               0.00113     0.082       2.79    5        
#>  df_error N  
#>  303      310
#>  303      310

# Within-subjects ANOVA.
set.seed(113)
n <- 20
rm_data <- data.frame(
  subject = factor(rep(seq_len(n), each = 3)),
  time    = factor(rep(c("Pre", "Mid", "Post"), n),
                   levels = c("Pre", "Mid", "Post")),
  y       = rnorm(n, sd = 1.5)[rep(seq_len(n), each = 3)] +
            0.7 * rep(1:3, n) + rnorm(n * 3, sd = 1.2)
)
fit_rm <- aov(y ~ time + Error(subject/time), data = rm_data)
ci_eta_squared_partial(fit_rm)
#>  effect eta_squared_partial lower_limit upper_limit stratum      F_value
#>  time   0.231               0.0152      0.322       subject:time 5.7    
#>  df_effect df_error N 
#>  2         38       60