*! version 1.0.0 03jul2026

Title

xtfmg all -- estimate all six estimators and report a
journal-style comparison table

Syntax

xtfmg all depvar indepvars [if] [in] [, options]

kfreq(#) Fourier frequency for F-SURMG and F-CCEMG; default 1

level(#) confidence level for the coefficient plot; default 95

coefplot comparison plot of all six estimates with confidence
intervals, one panel per regressor

notable suppress the comparison table

saving(filename) export the comparison table in journal
format (.tex, .rtf/.doc, .csv or .txt)

title(string) caption for the exported table

replace overwrite the export file if it exists

Description

xtfmg all runs FE, MG, CCEMG, SURMG, F-SURMG and F-CCEMG on the same
estimation sample and prints a comparison table in the format of Table 8 of
Guliyev (2026): one column per estimator, coefficient with significance
stars over the standard error in parentheses, sin/cos rows for
the mean-group Fourier coefficients, and a footer reporting N, average T,
the number of observations, the residual CD statistic and the
Bailey-Kapetanios-Pesaran CSD exponent (both from the Mean Group residuals,
as in the paper).

If the estimation sample is unbalanced, SURMG and F-SURMG are skipped with a
note (they require a balanced panel with T > N) and their columns are left
blank; the other four estimators are unaffected.

Agreement of all six estimators on the sign and significance of the
coefficient of interest is itself informative -- in the paper's G7
application, the conclusion that renewable-energy consumption has no
significant growth effect is robust precisely because all six estimators
agree, while the methodological comparison shows which estimates are
defensible for a panel of that shape.

Options

kfreq(#) sets the Fourier frequency used by F-SURMG and F-CCEMG;
default 1.

coefplot draws, for each regressor (up to 6), the six point estimates
with level()% confidence intervals, combined into a single figure named
xtfmg_coef. Missing estimators (skipped SUR columns) appear as gaps.

saving(filename) exports the six-column comparison table in
publication format chosen by the file extension: .tex (LaTeX,
booktabs rules, numbered columns (1)-(6), superscript stars), .rtf or
.doc (Word, Times New Roman, journal rules), .csv or
.txt. The notes report N, T, the number of observations, the Fourier
frequency, the CD statistic, the CSD exponent and the star legend --
ready to drop into a manuscript.

title(string) sets the exported table caption; replace permits
overwriting an existing file.

level(#); notable: see xtfmg fccemg.

Stored results

Scalars

r(N), r(Tbar), r(n), r(k), r(kfreq) panel dimensions and frequency

r(cd), r(cd_p), r(alpha) CSD diagnostics from MG residuals

r(balanced) 1 if the sample is balanced

Matrices

r(B) (k+2) x 6 matrix of estimates (rows: regressors, sin, cos;
columns: FE MG CCEMG SURMG F_SURMG F_CCEMG)

r(SE) matching matrix of standard errors

r(b_fe) ... r(b_fccemg) per-estimator coefficient vectors

r(V_fe) ... r(V_fccemg) per-estimator variance matrices

r(bunit_fccemg), r(seunit_fccemg) F-CCEMG unit-specific
estimates and standard errors

Examples

. webuse grunfeld, clear

. xtset company year

. xtfmg all invest mvalue kstock, coefplot

. matrix list r(B)

. matrix list r(SE)

Export the table for a manuscript

. xtfmg all invest mvalue kstock, saving(table1.tex) replace

. xtfmg all invest mvalue kstock, saving(table1.rtf) title(Investment regressions) replace

Author

Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane