*! version 1.0.0 09aug2026
help xtasym methodsVersion 1.0.0 9 August 2026

Title

xtasym methods -- the algebra behind xtasym, step by step,
and how each step maps onto the source papers

Notation

Panels are indexed by i = 1, ..., n and periods by t = 1, ..., T. x(i,t) is the
value of a variable for panel i in period t. c >= 0 is the threshold set by
threshold(). Increases are written with a plus superscript and decreases
with a minus superscript.

S1. First differences

The command forms

dx(i,t) = x(i,t) - x(i,t-1)

using Stata's D. operator, so the panel and time structure declared by
xtset is respected. dx is missing in the first period of every panel and
across any gap in the time variable. Missing first differences contribute
nothing anywhere below: they are not treated as zeros.

This last point is a deliberate difference from the replication code circulated
with Allison (2019) and with Thombs et al. (2022), which sets the missing first
difference to zero with replace dx = 0 if dx == . before accumulating.
The two are numerically identical when the panel is balanced with no gaps,
because Stata's sum() treats missing as zero anyway. They differ when the
time variable has gaps, and treating a gap as a period of no change would be
wrong.

S2. Thresholded decomposition

The first difference is split into an increase part and a decrease part around
a symmetric dead band of half-width c:

dx+(i,t) = dx(i,t) if dx(i,t) > +c, otherwise 0

dx-(i,t) = dx(i,t) if dx(i,t) < -c, otherwise 0

so that a change lying in [-c, c] is classified as no change and contributes to
neither part. With c = 0 this is exactly eq. (13) of Thombs et al. (2022) and
the definition in section 3 of Allison (2019), and

dx(i,t) = dx+(i,t) + dx-(i,t)

identically. With c > 0 the identity holds only up to the changes absorbed by
the dead band, which is the intended behaviour.

A note on the threshold. Applying c to only one arm — counting a change as
a decrease whenever it is less than +c rather than less than -c —
puts small positive changes into the negative part. xtasym always
uses the symmetric band above. This is the one place where its output differs
from xtasysum when threshold() is not zero.

The contribution of a change that clears the band is the whole first
difference, not the excess over c. That is the convention in this literature
and it keeps the sum of the two arms equal to the total movement of the series.

The fdm option stores dx+ and dx- themselves, as
var_pfd and var_nfd. These are the regressors of the
first-difference method of York and Light (2017) and Allison (2019, sec. 3),
in which the dependent variable is also differenced.

S3. Partial sums

S3a. Shin, Yu and Greenwood-Nimmo (2014), the default. The two arms are
accumulated with their own signs:

x+(i,t) = sum over j <= t of max(dx(i,j), 0)

x-(i,t) = sum over j <= t of min(dx(i,j), 0)

This is eq. (14) of Thombs et al. (2022). x+ is non-decreasing and
non-negative; x- is non-increasing and non-positive. They are stored as
var_p and var_n.

S3b. Allison (2019, sec. 6). The negative arm is accumulated in absolute
value:

Z+(i,t) = sum over j <= t of dx+(i,j)

Z-(i,t) = sum over j <= t of -dx-(i,j)

Both are non-decreasing and non-negative. When x is a dummy, Z+ counts the
transitions from 0 to 1 up to t and Z- counts the transitions from 1 to 0
— Allison's "number of previous marriages" and "number of previous divorces".
Selected with convention(allison).

Equivalence of the two conventions

The two constructions carry the same information:

x+(i,t) = Z+(i,t) x-(i,t) = -Z-(i,t)

Fit y on x+ and x- with coefficients b+ and b-, and y on
Z+ and Z- with coefficients g+ and g-. Then

g+ = b+ g- = -b-

The fitted values, the residuals and every test statistic that does not
reference the sign of the negative arm are identical. What changes is the
symmetry restriction:

under Shin: H0: b+ = b-

under Allison: H0: g+ = -g-

Both say the same thing — a unit increase and a unit decrease move y by equal
and opposite amounts — but the test command you type is different, and
typing the wrong one tests a hypothesis nobody wants. xtasym prints the
applicable restriction in its header.

The reading of a coefficient also flips. Under the Shin convention a positive
coefficient on x- means that a fall in x lowers y, because x- itself
falls. This is the meaning of the note to Table 5 of Thombs et al. (2022).

Why accumulate at all

Allison (2019, sec. 6) supplies the data-generating model that justifies the
accumulation. Suppose

y(i,t) = m(t) + b+ Z+(i,t) + b- Z-(i,t) + a(i) + e(i,t)

with a(i) an arbitrary panel effect. First-differencing gives

dy(i,t) = m(t) - m(t-1) + b+ dx+(i,t) + b- dx-(i,t) + de(i,t)

because Z+(i,t) - Z+(i,t-1) = dx+(i,t) and likewise for the
negative arm. So the levels model in the accumulated variables and the
first-difference model in the period-by-period components have the same
parameters. Allison's Appendix 1 shows that when b+ = -b- the model
collapses back to a symmetric model in x itself, so the symmetric specification
is nested.

Two consequences matter in practice. First, the effect of a change persists
until it is offset by a change in the other direction — Lieberson's irreversible
process. Second, because the levels form does not difference the dependent
variable, it extends directly to non-linear models: Allison (2019, sec. 7)
estimates an asymmetric fixed-effects logit by putting Z+ and Z- into
clogit. Use convention(allison) for that.

Thombs et al. (2022) additionally show that partial sums, unlike the
period-by-period components, allow long-run effects to be identified once
the model is written as an autoregressive distributed lag; the components alone
support only short-run effects.

S4. Directional frequency table

For each variable the command counts

n+ = #{ dx > +c }, n- = #{ dx < -c }, n0 = #{ -c <= dx <= c }

over the estimation sample, excluding missing first differences, and reports
each as a percentage of n+ + n- + n0. This is Table 1 of Thombs et
al. (2022). Counts are obtained with count rather than by reading a
cross-tabulation, so a variable in which some direction never occurs is handled
correctly rather than shifting the columns.

S5. Within and between dispersion

xtsum decomposes the variation in each partial sum into a between-panel
part and a within-panel part. Fixed-effects, mean-group and common-correlated-
effects estimators all identify from the within part. A partial sum whose
within standard deviation is close to zero is collinear with the panel effect
and cannot carry an asymmetric coefficient, whatever the estimator; the remedy
is usually a larger threshold, following the suggestion in note 10 of Thombs et
al. (2022).

S6. Pesaran (2015) CD statistic

For a single series, let r(i,j) be the sample correlation between panels i and
j computed over their T(i,j) common non-missing periods. The statistic is

CD = sqrt( 2 / (n(n-1)) ) * sum over i<j of sqrt(T(i,j)) * r(i,j)

which is standard normal under the null of weak cross-sectional dependence.
xtasym computes this internally in Mata, so no other package is required.
Pairs sharing fewer than three periods, or in which either series is constant,
are dropped from the sum; the number of usable pairs is reported. The table
also gives the mean correlation and the mean absolute correlation, which
distinguish a large CD driven by a few strong links from one driven by
pervasive dependence.

The exponent of cross-sectional dependence alpha (Bailey, Kapetanios and
Pesaran 2016) is not computed here; when xtcse2 is installed its
estimate is read and displayed. Values of alpha in [0.5, 1) indicate strong
dependence, which is what makes a common-correlated-effects estimator
preferable to time dummies.

S7. Pesaran (2007) CIPS

The cips() option is a wrapper: it calls xtcips for each partial
sum and reformats the statistic, the critical values and a verdict into one
table. The test is left-tailed, so the null of a homogeneous unit root is
rejected when CIPS falls below the critical value. Nothing is recomputed here,
so results agree with xtcips exactly.

Partial sums of an I(1) series are ordinarily non-stationary. That is expected,
not a defect: it is one reason Thombs et al. (2022) work in autoregressive
distributed lag or error-correction form rather than in a static regression.

Step to equation map

Step Source

S1 first difference; D. operator under xtset

S2 Allison (2019) sec. 3; Thombs et al. (2022) eq. (13)

S3a Shin et al. (2014); Thombs et al. (2022) eq. (14)

S3b Allison (2019) sec. 6, Z+ and Z-

equivalence Allison (2019) eq. (3) and Appendix 1

S4 Thombs et al. (2022) Table 1

S5 Thombs et al. (2022) Table 2

S6 Pesaran (2015); Thombs et al. (2022) Table 3

S7 Pesaran (2007); Thombs et al. (2022) Table 3

Choosing an estimator for the partial sums

The Monte Carlo evidence in Thombs et al. (2022) is a decision rule. Their
findings, in short:

o A static model is dynamically misspecified whenever the process
is autoregressive. Their Experiment 1 finds bias above 25 per cent on the
positive arm and above 50 per cent on the negative arm at every combination of
n and T they consider. Start from an autoregressive distributed lag or an
error-correction specification and restrict it only if the data allow.

o Under slope heterogeneity, dynamic fixed effects give long-run
effects that are wildly unstable and do not improve as T grows — bias reaching
several thousand per cent in their Experiment 2 — because the numerator and the
denominator of the long-run formula both tend to zero. The mean-group estimator
of Pesaran and Smith (1995) fixes this. Pre-test with xthst.

o Under cross-sectional dependence with homogeneous slopes, two-way
fixed effects performed well in their design, occasionally better than the
pooled common-correlated-effects estimator; but with both problems present the
common-correlated-effects estimator of Pesaran (2006), in the dynamic form of
Chudik and Pesaran (2015), is the one to use. Pre-test with the csd
option of this command.

Note that Thombs et al. (2022, note 9) disagree with Allison's recommendation
of generalized least squares for the multi-period case: GLS treats
autocorrelation as a nuisance to be corrected, whereas in the large-T setting
it is usually a symptom of misspecified dynamics, which no correction to the
error structure can repair. Allison's GLS route remains the right one when T is
small and the model really is static.

Limitations

o xtasym builds and describes regressors. It does not estimate a
model and does not test asymmetry; the restriction to test is stated in the
header and you impose it with test, nlcom or the equivalent
after your own estimation command.

o The CIPS option depends on xtcips; its critical values are
unreliable with unbalanced panels, as that command documents.

o The CD statistic is a large-n result and should not be read
literally with a handful of panels.

o Dynamic multipliers in the sense of Shin et al. (2014) are a property
of an estimated model, not of the partial sums, and so are outside the scope of
this command.

Author

Dr Merwan Roudane

Email: merwanroudane920@gmail.com

GitHub: github.com/merwanroudane

Also see

Help: xtasym

Manual: xtset, xtsum, xtreg