I wrote two DO-files to test whether some estat esize problems that have been discussed in the past have been fixed in Stata 15. Cutting to the chase, no, they have not been fixed. 
In summary:
.
Finally, here is the code (without output), in case anyone wants it.

In summary:
- Following one-way (independent groups) ANOVA, estat esize, omega computes epsilon^2, not omega^2.
- Following one-way repeated measures ANOVA, estat esize computes a partial eta^2, but labels it eta^2.
- https://www.statalist.org/forums/for...16#post1364816
- http://daniellakens.blogspot.ca/2015...a-squared.html
Code:
. do "C:\bw\Stata\DO files\ANOVA\Oneway_ANOVA_omegaSq_Bug.do" . * Date: 15-Jun-2017 . * File: Oneway_ANOVA_omegaSq_test.DO . * Author: Bruce Weaver, [email protected] . * Stata version used: Stata/IC v15 (Windows, 64-bit) . . * Q. Following one-way ANOVA, does -estat esize, omega- . * actually compute epsilon^2? . . clear . use https://stats.idre.ucla.edu/stat/stata/faq/crf24 (CRF Example - Kirk, 1st Edition) . *https://stats.idre.ucla.edu/stata/faq/ . anova y b Number of obs = 32 R-squared = 0.8259 Root MSE = 1.21008 Adj R-squared = 0.8072 Source | Partial SS df MS F Prob>F -----------+---------------------------------------------------- Model | 194.5 3 64.833333 44.28 0.0000 | b | 194.5 3 64.833333 44.28 0.0000 | Residual | 41 28 1.4642857 -----------+---------------------------------------------------- Total | 235.5 31 7.5967742 . *ereturn list . * Hand calculation of eta^2: . display "eta^2 = " e(ss_1)/(e(ss_1)+e(rss)) eta^2 = .82590234 . estat esize // eta^2 computed by Stata Effect sizes for linear models ------------------------------------------------------------------- Source | Eta-Squared df [95% Conf. Interval] --------------------+---------------------------------------------- Model | .8259023 3 .6545609 .8756227 | b | .8259023 3 .6545609 .8756227 ------------------------------------------------------------------- . * Hand calculations of omega^2 & epsilon^2: . local sst = e(mss)+e(rss) // SS_total = SS_model + SS_residual . local msr = e(rss)/e(df_r) // MS_residual . display " omega^2 = " (e(ss_1)-e(df_1)*`msr')/(`sst'+`msr') omega^2 = .80226074 . display "epsilon^2 = " (e(ss_1)-e(df_1)*`msr')/`sst' epsilon^2 = .80724901 . * Now use -estat esize- . estat esize, omega Effect sizes for linear models ------------------------------------------------------------------- Source | Omega-Squared df [95% Conf. Interval] --------------------+---------------------------------------------- Model | .807249 3 .6175495 .8622965 | b | .807249 3 .6175495 .8622965 ------------------------------------------------------------------- . . * Compare with result from Phil Ender's -omega2- program . * package name: omega2.pkg . * To install: net install omega2.pkg . omega2 omega squared for b = 0.8023 fhat effect size = 2.0142 . . * CONCLUSIONS: . * 1. The result from -estat esize- matches my computation of eta^2. . * 2. The result from -estat esize, omega- matches my computation of epsilon^2. . * 3. The result from Phil Ender's omega2 matches my computation of omega^2. . . * REFERENCES . * https://www.statalist.org/forums/forum/general-stata-discussion/general/1364356-effect-sizes > -with-blank-or-zero-confidence-intervals?p=1364816#post1364816 . * http://daniellakens.blogspot.ca/2015/06/why-you-should-use-omega-squared.html . end of do-file
Code:
. do "C:\bw\Stata\DO files\ANOVA\Oneway_RM_ANOVA_etaSq_Bug.do" . * Date: 15-Jun-2017 . * File: Oneway_RM_ANOVA_etaSq_Bug.DO . * Author: Bruce Weaver, [email protected] . * Stata version: Stata/IC v15 (Windows, 64-bit) . . * Q. Is -estat esize- after one-factor repeated measures ANOVA . * computing eta-squared correctly? . . * Use data from this example: . * http://core.ecu.edu/psyc/wuenschk/MV/RM-ANOVA/RM1_Eta-Squared.pdf . . clear . input score1-score5 score1 score2 score3 score4 score5 1. 21 22 8 6 6 2. 20 19 10 4 4 3. 17 15 5 4 5 4. 25 30 13 12 17 5. 30 27 13 8 6 6. 19 27 8 7 4 7. 26 16 5 2 5 8. 17 18 8 1 5 9. 26 24 14 8 9 10. end . * Reshape data from wide to long for use with -anova- command . generate id = _n . reshape long score, i(id) j(week) (note: j = 1 2 3 4 5) Data wide -> long ----------------------------------------------------------------------------- Number of obs. 9 -> 45 Number of variables 6 -> 3 j variable (5 values) -> week xij variables: score1 score2 ... score5 -> score ----------------------------------------------------------------------------- . * Perform one-way RM ANOVA . anova score id week, repeated(week) Number of obs = 45 R-squared = 0.9272 Root MSE = 2.68328 Adj R-squared = 0.8999 Source | Partial SS df MS F Prob>F -----------+---------------------------------------------------- Model | 2935.9111 12 244.65926 33.98 0.0000 | id | 486.71111 8 60.838889 8.45 0.0000 week | 2449.2 4 612.3 85.04 0.0000 | Residual | 230.4 32 7.2 -----------+---------------------------------------------------- Total | 3166.3111 44 71.961616 Between-subjects error term: id Levels: 9 (8 df) Lowest b.s.e. variable: id Repeated variable: week Huynh-Feldt epsilon = 1.0756 *Huynh-Feldt epsilon reset to 1.0000 Greenhouse-Geisser epsilon = 0.6845 Box's conservative epsilon = 0.2500 ------------ Prob > F ------------ Source | df F Regular H-F G-G Box -----------+---------------------------------------------------- week | 4 85.04 0.0000 0.0000 0.0000 0.0000 Residual | 32 ---------------------------------------------------------------- . *ereturn list . * ------------------------------------------ . * My computations of eta^2 and partial eta^2 . * ------------------------------------------ . display " SS_week = " e(ss_2) SS_week = 2449.2 . display "SS_error = " e(rss) SS_error = 230.4 . display " SS_id = " e(ss_1) SS_id = 486.71111 . display e(ss_2)/(e(ss_2)+e(rss)) " Partial eta^2 for Week" .91401702 Partial eta^2 for Week . display e(ss_2)/(e(ss_2)+e(rss)+e(ss_1)) " Eta^2 for Week" .77351843 Eta^2 for Week . * ------------------------------------- . * Stata's computation via -estat esize- . * ------------------------------------- . estat esize Effect sizes for linear models ------------------------------------------------------------------- Source | Eta-Squared df [95% Conf. Interval] --------------------+---------------------------------------------- Model | .9272339 12 .8237562 .9340545 | id | .6787109 8 .35672 .734409 week | .914017 4 .8292137 .9359729 ------------------------------------------------------------------- . . * CONCLUSION: . * Following one-way RM ANOVA, -estat esize- computes . * partial eta^2, but reports it as eta^2. . . end of do-file
Finally, here is the code (without output), in case anyone wants it.
Code:
* Date: 15-Jun-2017 * File: Oneway_ANOVA_omegaSq_test.DO * Author: Bruce Weaver, [email protected] * Stata version used: Stata/IC v15 (Windows, 64-bit) * Q. Following one-way ANOVA, does -estat esize, omega- * actually compute epsilon^2? clear use https://stats.idre.ucla.edu/stat/stata/faq/crf24 *https://stats.idre.ucla.edu/stata/faq/ anova y b *ereturn list * Hand calculation of eta^2: display "eta^2 = " e(ss_1)/(e(ss_1)+e(rss)) estat esize // eta^2 computed by Stata * Hand calculations of omega^2 & epsilon^2: local sst = e(mss)+e(rss) // SS_total = SS_model + SS_residual local msr = e(rss)/e(df_r) // MS_residual display " omega^2 = " (e(ss_1)-e(df_1)*`msr')/(`sst'+`msr') display "epsilon^2 = " (e(ss_1)-e(df_1)*`msr')/`sst' * Now use -estat esize- estat esize, omega * Compare with result from Phil Ender's -omega2- program * package name: omega2.pkg * To install: net install omega2.pkg omega2 * CONCLUSIONS: * 1. The result from -estat esize- matches my computation of eta^2. * 2. The result from -estat esize, omega- matches my computation of epsilon^2. * 3. The result from Phil Ender's omega2 matches my computation of omega^2. * REFERENCES * https://www.statalist.org/forums/forum/general-stata-discussion/general/1364356-effect-sizes-with-blank-or-zero-confidence-intervals?p=1364816#post1364816 * http://daniellakens.blogspot.ca/2015/06/why-you-should-use-omega-squared.html
Code:
* Date: 15-Jun-2017 * File: Oneway_RM_ANOVA_etaSq_Bug.DO * Author: Bruce Weaver, [email protected] * Stata version: Stata/IC v15 (Windows, 64-bit) * Q. Is -estat esize- after one-factor repeated measures ANOVA * computing eta-squared correctly? * Use data from this example: * http://core.ecu.edu/psyc/wuenschk/MV/RM-ANOVA/RM1_Eta-Squared.pdf clear input score1-score5 21 22 8 6 6 20 19 10 4 4 17 15 5 4 5 25 30 13 12 17 30 27 13 8 6 19 27 8 7 4 26 16 5 2 5 17 18 8 1 5 26 24 14 8 9 end * Reshape data from wide to long for use with -anova- command generate id = _n reshape long score, i(id) j(week) * Perform one-way RM ANOVA anova score id week, repeated(week) *ereturn list * ------------------------------------------ * My computations of eta^2 and partial eta^2 * ------------------------------------------ display " SS_week = " e(ss_2) display "SS_error = " e(rss) display " SS_id = " e(ss_1) display e(ss_2)/(e(ss_2)+e(rss)) " Partial eta^2 for Week" display e(ss_2)/(e(ss_2)+e(rss)+e(ss_1)) " Eta^2 for Week" * ------------------------------------- * Stata's computation via -estat esize- * ------------------------------------- estat esize * CONCLUSION: * Following one-way RM ANOVA, -estat esize- computes * partial eta^2, but reports it as eta^2.
Comment