Home  /  Products  /  Features  /  Effect sizes

<-  See Stata's other features

Highlights

  • Comparison of means

    • Cohen's d

    • Hedges's g

    • Glass's Δ

    • Point/biserial correlation

    • Estimated from data or published summary statistics

  • Variance explained by regression and ANOVA

    • Eta-squared and partial eta-squared (η2)

    • Epsilon-squared and partial epsilon-squared (ε2)

    • Partial statistics estimated from data

    • Overall statistics from data or published summary statistics

  • With confidence intervals

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:

. webuse lbw
(Hosmer & Lemeshow data)

. esize twosample bwt, by(smoke) all

Effect size based on mean comparison

                               Obs per group:
                                   Nonsmoker =        115
                                      Smoker =         74

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:

. bootstrap r(d) r(g), reps(200) nowarn seed(111): esize twosample bwt, by(smoke)
(running esize on estimation sample)

Bootstrap replications (200): .........10.........20.........30.........40.........50.........60..
> .......70.........80.........90.........100.........110.........120.........130.........140.....
> ....150.........160.........170.........180.........190.........200 done

Bootstrap results                                          Number of obs = 189
                                                           Replications  = 200

      Command: esize twosample bwt, by(smoke)
        _bs_1: r(d)
        _bs_2: r(g)

Observed Bootstrap Normal-based
coefficient std. err. z P>|z| [95% conf. interval]
_bs_1 .3938497 .1391761 2.83 0.005 .1210697 .6666298
_bs_2 .3922677 .138617 2.83 0.005 .1205833 .663952

Effect sizes based on summary statistics

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

. esizei 115 3054.957 752.409    74 2772.297 659.807541

Effect size based on mean comparison

                               Obs per group:
                                     Group 1 =        115
                                     Group 2 =         74

Effect size Estimate [95% conf. interval]
Cohen's d .3938508 .0985343 .6881333
Hedges's g .3922687 .0981385 .685369

Effect sizes for ANOVA (proportion of variability explained)

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:

. anova bwt smoke##ftv

                         Number of obs =        189    R-squared     =  0.0860
                         Root MSE      =    716.273    Adj R-squared =  0.0347

Source Partial SS df MS F Prob>F
Model 8592836.5 10 859283.65 1.67 0.0897
smoke 192977.93 1 192977.93 0.38 0.5405
ftv 2200463.6 5 440092.72 0.86 0.5107
smoke#ftv 2322255.1 4 580563.77 1.13 0.3432
Residual 91322462 178 513047.54
Total 99915299 188 531464.35

We can obtain the proportion of variability explained (effect sizes) measured by η2, ε2, or ω2. Here is the default η2 measure:

. estat esize

Effect sizes for linear models

Source Eta-squared df [95% conf. interval]
Model .0860012 10 . .1214932
smoke .0021087 1 . .0351462
ftv .0235286 5 . .054553
smoke#ftv .0247986 4 . .0642531
Note: Eta-squared values for individual model terms are partial.

Reported are full and partial η2 values along with their confidence intervals. We could have added the epsilon or omega option to instead request the ε2 or ω2 measure.

Effect sizes for linear models (proportion of variability explained)

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.

. regress bwt smoke##c.age

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 Coefficient 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:

. estat esize, omega

Effect sizes for linear models

Source Omega-squared df
Model .0532781 3
smoke .0090843 1
age -.0044019 1
smoke#c.age .0218418 1
Note: Omega-squared values for individual model terms are partial.

Reported are full and partial ω2 values.

ANOVA and regression effect sizes from summary statistics

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, ε2, and ω2 from the model's degrees of freedom and the summary statistic that F(3, 185) = 4.55. We could type

. esizei 3 185 4.55

Effect sizes for linear models

Effect Size Estimate [95% conf. interval]
Eta-squared .0687138 .0079234 .1364187
Epsilon-squared .0536119
Omega-squared .0533434

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.

Tell me more

See the manual entry.