*! version 2.0.4 21Mar2024

*! version 2.0.3 07Mar2024

*! version 2.0.2 29Feb2024

*! version 2.0.1 26Feb2024

*! version 2.0.0 29May2019

Title

esizereg -- Effect size based on a linear regression coefficient

Syntax

Postestimation version of esizereg

esizereg
coef_name
,
[
cohensd
hedgesg
zdistribution
level(#)
]

Immediate form of esizereg

esizeregi
#coefficient
,
sdp(#)
n1(#)
n2(#)
[
cohensd
hedgesg
zdistribution
level(#)
]

In the postestimation version of esizereg, coef_name identifies a coefficient in the preceding estimation model. coef_name is typically
a variable name with or without a level indicator (see fvvarlist). The easiest way to identify the coef_name assigned by the estimation model
is to specify the coeflegend option; see estimation options.

In the immediate version of esizereg, coefficient is the actual numeric value of the coefficient.

In either version of esizereg, the coefficient must be for binary level variable, as esizereg computes the standardized mean difference between 2 levels of a variable.

esizereg

cohensd report Cohen's d (1988)

hedgesg report Hedges's g (1981)

zdistribution compute confidence limits using z test instead of default t test (with non-centrality parameter)

level(#) set confidence level; default is level(95)

esizeregi

* sdp(#) the within-sample pooled standard deviation

* n1(#) number of observations in group 1

* n2(#) number of observations in group 2

cohensd report Cohen's d (1988)

hedgesg report Hedges's g (1981)

zdistribution compute confidence limits using z test instead of default t test (with non-centrality parameter)

level(#) set confidence level; default is level(95)

* sdp, n1 and n2 are required.

Description

esizereg is a postestimation command that calculates Cohen's d (Cohen 1988) and Hedges's g (Hedges 1981) effect size for both the unadjusted
and adjusted mean difference of a continuous variable between two groups. esizereg uses the unstandardized regression coefficient of the treatment
variable as the numerator (which is equivalent to the difference between two covariate unadjusted or adjusted means) and uses the pooled within-sample
estimate of the population standard deviation (estimated with margins) as the denominator. Estimation models currently supported by esizereg
are regress, tobit, truncreg, hetregress, xtreg, intreg, meintreg and metobit. When a
weight is specified in the estimation model, esizereg produces a weighted effect size estimate.

esizeregi is the immediate form of esizereg; see immed.

Options

sdp(#) specifies the within-sample pooled standard deviation. This can be derived by running the post-estimation margins command without any
predictor variables, and then converting the pooled standard error to the pooled standard deviation by multipying it by the square-root of N (standard error * sqrt(N));
sdp() is required for esizeregi.

n1(#) specifies the number of observations in group 1. The number of observations in each group can be found by running the tabulate oneway command on the
treatment variable; n1() is required for esizeregi.

n2(#) specifies the number of observations in group 2; n2() is required for esizeregi.

cohensd specifies that Cohen's d (1988) be reported.

hedgesg specifies that Hedges's g (1981) be reported.

zdistribution specifies that the z distribution be used to compute confidence limits rather than the default t distribution
(with a non-centrality parameter).

level(#) specifies the confidence level, as a percentage, for confidence intervals. The default is level(95).

Examples

1) esizereg

Setup

. webuse cattaneo2

A simple case with no covariate adjustment. We estimate the treatment effect of mbsmoke on bweight.

. regress bweight mbsmoke

Compute the effect size for mbsmoke.

. esizereg mbsmoke

Compare the results with those produced by esize.

. esize twosample bweight, by(mbsmoke)

We now estimate the treatment effect of mbsmoke on bweight, controlling for several covariates (which esize cannot do).

. regress bweight mbsmoke mmarried mage fbaby medu

Compute the effect size for mbsmoke.

. esizereg mbsmoke

Use a z distribution to compute confidence limits instead of the default t distribution (with a non-centrality parameter).

. regress bweight mbsmoke mmarried mage fbaby medu

. esizereg mbsmoke , z

Re-estimate the model, now specifying mbsmoke as a factor variable, and adding a pweight.

. regress bweight i.mbsmoke mmarried mage fbaby medu [pw=nprenatal]

Compute the weighted effect size for 1.mbsmoke.

. esizereg 1.mbsmoke

2) esizeregi

Estimate the treatment effect of mbsmoke on bweight, controlling for several covariates.

. regress bweight mbsmoke mmarried mage fbaby medu

Get the pooled standard error of the adjusted model using margins.

. margins

Convert the pooled standard error to a pooled standard deviation by multipying it by the square-root of N (4642).

. display 8.253892 * sqrt(4642)

Get the number of observations in each group of mbsmoke.

. tab mbsmoke

Compute the effect size.

. esizeregi -224.422, sdp(562.355997) n1(864) n2(3778)

Compute confidence limits using z distribution.

. esizeregi -224.422, sdp(562.355997) n1(864) n2(3778) zdist

Conduct a sensitivity analysis using the effect size and standard error values produced by esizereg.

. evalue smd -0.399075, se(0.037937)

Same as above, but using the local macros d and se generated by esizereg or esizeregi.

. evalue smd `d', se(`se')

Stored results

esizereg stores the following in r():

Scalars

r(est) model coefficient for the point estimate

r(V) pooled variance

r(sdpooled) pooled standard deviation

r(n1) sample size of group 1

r(n2) sample size of group 2

r(d) Cohen's d

r(se) standard error of the Cohen's d estimate

r(lb_d) lower confidence bound for Cohen's d

r(ub_d) upper confidence bound for Cohen's d

r(g) Hedge's g

r(lb_g) lower confidence bound for Hedge's g

r(ub_g) upper confidence bound for Hedge's g

esizereg also stores the following local macros, making them accessible for later use:

Macros

d Cohen's d

g Hedge's g

se standard error of the Cohen's d estimate

References

Cohen, J. 1988. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Erlbaum.

Hedges, L. V. 1981. Distribution theory for Glass's estimator of effect size and related estimators. Journal of Educational Statistics 6: 107-128.

Lipsey, M. W., and Wilson, D. B. (2001). Applied social research methods series; Vol. 49. Practical meta-analysis. Thousand Oaks, CA, US: Sage Publications, Inc.

Citation of esizereg

esizereg is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden A. (2019). ESIZEREG: Stata module for calculating effect size based on a linear regression coefficient.
Statistical Software Components S458607, Boston College Department of Economics.

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: esize, evalue , evalue_estat if installed