
Effect sizes | ORDER STATA |
esize, esizei, and estat esize calculate measures of effect size for (1) the difference between two means and (2) the proportion of variance explained.
Say we have data on mothers and their infants' birthweights. We want to calculate the effect size on birthweight of smoking during pregnancy:
Effect Size | Estimate [95% Conf. Interval] | |
Cohen's d | .3938497 .0985333 .6881322 | |
Hedges's g | .3922677 .0981375 .685368 | |
Glass's Delta 1 | .3756723 .0787487 .6709925 | |
Glass's Delta 2 | .4283965 .1267939 .7272194 | |
Point-Biserial r | .1897497 .0482935 .3199182 | |
We find that the difference in average birthweight is about 0.4 standard deviations.
We can reasonably assume birthweight is normally distributed; thus the reported confidence intervals are appropriate in this case.
In many cases, normality cannot reasonably be assumed. In such cases, we can obtain bootstrapped confidence intervals:
Observed Bootstrap Normal-based | ||
Coef. Std. Err. z P>|z| [95% Conf. Interval] | ||
_bs_1 | .3938497 .145659 2.70 0.007 .1083633 .6793362 | |
_bs_2 | .3922677 .1450739 2.70 0.007 .107928 .6766073 | |
When you have summary statistics but not the underlying data, as you might when reading a journal article, you can use Stata's immediate command. Let's pretend our birthweight example was published. The hypothetical article recorded that for the 115 mothers who did not smoke, the average birthweight was 3,054.957 grams (sd=752.409) and that for the 74 smokers, the average was 2772.297 grams (sd=659.8075). We type
Effect Size | Estimate [95% Conf. Interval] | |
Cohen's d | .3938508 .0985343 .6881333 | |
Hedges's g | .3922687 .0981385 .6853691 | |
We can use the estat esize postestimation command to calculate effect sizes after fitting ANOVA models.
We fit a full factorial model of newborn birthweight on mother's smoking status and whether the mother saw a doctor during her first trimester:
Source | Partial SS df MS F Prob > F | ||
Model | 4707585.52 3 1569195.17 3.05 0.0299 | ||
smoke | 3275249.66 1 3275249.66 6.36 0.0125 | ||
drvisit | 612385.434 1 612385.434 1.19 0.2768 | ||
smoke#drvisit | 248303.954 1 248303.954 0.48 0.4882 | ||
Residual | 95207713.1 185 514636.287 | ||
Total | 99915298.6 188 531464.354 |
We can obtain the proportion of variability explained (effect sizes) measured by η2 or ω2. Here is the default η2 measure:
Source | Eta-Squared df [95% Conf. Interval] | |
Model | .0471158 3 0 .1062782 | |
smoke | .033257 1 .0014433 .0975557 | |
drvisit | .006391 1 0 .0474531 | |
c.smoke#c.drvisit | .0026012 1 0 .0361357 | |
Reported are full and partial η2 values along with their confidence intervals. We would have obtained similar output had we requested the ω2 measure.
We can also use the estat esize postestimation command to calculate effect sizes after fitting linear models.
We replace the insignificant drvisit variable with the continuous variable age and fit the model using linear regression.
Source | SS df MS | Number of obs = 189 | |
F( 3, 185) = 4.55 | |||
Model | 6859112.22 3 2286370.74 | Prob > F = 0.0042 | |
Residual | 93056186.4 185 503006.413 | R-squared = 0.0686 | |
Adj R-squared = 0.0535 | |||
Total | 99915298.6 188 531464.354 | Root MSE = 709.23 |
bwt | Coef. Std. Err. t P>|t| [95% Conf. Interval] | |
smoke | ||
smoker | 797.9369 484.3249 1.65 0.101 -157.5731 1753.447 | |
age | 27.60058 12.14868 2.27 0.024 3.632806 51.56835 | |
smoke#c.age | ||
smoker | -46.51558 20.44641 -2.28 0.024 -86.85368 -6.177479 | |
_cons | 2408.383 292.1796 8.24 0.000 1831.951 2984.815 | |
This time, we request the ω2 estimates of effect size:
Source | Omega-Squared df [95% Conf. Interval] | |
Model | .0535463 3 0 .1223273 | |
smoke | .0091327 1 0 .0601797 | |
age | 0 1 0 .0231396 | |
c.smoke#c.age | .0219567 1 0 .0829855 | |
Reported are full and partial ω2 values.
If we did not have the data to estimate this model but instead found the regression fit published in a journal, we could still estimate the overall η2 and ω2 from the model's degrees of freedom and the summary statistic that F(3, 185) = 4.55. We could type
Effect Size | Estimate [95% Conf. Interval] | |
Eta-Squared | .0687138 .0079234 .1364187 | |
Omega-Squared | .0536119 0 .1224147 | |
The η2 agrees to three decimal places. Had we typed 4.5454107 rather than 4.55, we would have had full agreement to the shown eight decimal places.
See the manual entry.
See New in Stata 18 to learn about what was added in Stata 18.