R中2×2混合设计ANOVA的偏Eta平方获取及效应对应IV识别
Great job setting up your 2×2 mixed ANOVA with ezANOVA! Let’s break down how to extract partial eta squared values and map each effect to your independent variables (IVs).
1. Extracting Partial Eta Squared
When you run ezANOVA with detailed = TRUE, the output already includes partial eta squared in the p2 column of the main ANOVA results table. To access this directly:
- The core ANOVA results are stored in
results$ANOVA. You can print a clean table of effect names and their partial eta squared values with this code:# Show only effect names and partial eta squared results$ANOVA[, c("Effect", "p2")]
Each row in this subset corresponds to an effect, and the p2 value is the partial eta squared for that effect.
2. Mapping Effects to Your IVs
Your design has two key factors:
- Between-subjects:
Language(group-level variable) - Within-subjects:
Condition(repeated measure across participants)
Here’s how each row in results$ANOVA maps to your variables:
- Row labeled
Language: Main effect of your between-subjects IV (Language) - Row labeled
Condition: Main effect of your within-subjects IV (Condition) - Row labeled
Language:Condition: Interaction effect between the two IVs - Rows starting with
Errorare the error terms for each effect—you don’t need these for interpreting your main hypotheses.
Example Output Breakdown
If your results$ANOVA looks like this:
| Effect | DFn | DFd | F | p | p2 |
|---|---|---|---|---|---|
| (Intercept) | 1 | 18 | 245.67 | <0.001 | 0.932 |
| Language | 1 | 18 | 4.23 | 0.054 | 0.190 |
| Condition | 1 | 18 | 12.56 | 0.002 | 0.412 |
| Language:Condition | 1 | 18 | 3.11 | 0.095 | 0.148 |
| Error(Language) | 18 | NA | NA | NA | NA |
| Error(Condition) | 18 | NA | NA | NA | NA |
You can immediately see:
- Partial eta squared for Language: 0.190
- Partial eta squared for Condition: 0.412
- Partial eta squared for their interaction: 0.148
Bonus: Manual Calculation (If Needed)
If you ever want to compute partial eta squared yourself (though ezANOVA handles this for you), use this formula:
partial_eta_squared = SS_effect / (SS_effect + SS_error)
Where SS_effect is the sum of squares for the effect (found in the SSn column) and SS_error is the sum of squares for the corresponding error term (found in the SSd column).
内容的提问来源于stack exchange,提问作者R is DooDoo

