*! version 1.0 09Oct2025

em -- Modified Jones Model for Earnings Management Measurement

Title

em - Calculate earnings management measures using the Modified Jones Model (Dechow et al., 1995)

Syntax

em [using] [, datafolder(string) outputfolder(string) replace]

options

using path to raw data Excel file; default is "D:\Academic Friends\Dingyuan Accounting 202502\data\emdata\rawdata.xlsx"

datafolder(string) path to folder containing Excel data files; alternative to using

outputfolder(string) path to folder for output files; default is "D:\Academic Friends\Dingyuan Accounting 202502\report"

replace overwrite existing log and output files

Description

em implements the Modified Jones Model (Dechow, Sloan, and Sweeney, 1995)
for measuring earnings management through discretionary accruals. The command
processes financial statement data from Excel files, estimates model parameters
by year-industry groups, and calculates both discretionary and non-discretionary accruals.

The command automatically handles log file management, closes any open logs before
starting, and generates comprehensive output including descriptive statistics
and regression results.

Options

using specifies the path to the raw data Excel file containing all required
data sheets. The file must contain four sheets named Sheet1, Sheet2, Sheet3, and Sheet4
with appropriate data structure. Default is "D:\Academic Friends\Dingyuan Accounting 202502\data\emdata\rawdata.xlsx".

datafolder(string) specifies the path to the folder containing the
required Excel data files. This is an alternative to the using option.
Default is "D:\Academic Friends\Dingyuan Accounting 202502\data\emdata".

outputfolder(string) specifies the path to the folder where output
files will be saved. The command will create several output files including
the main dataset, log file, and statistical tables. Default is
"D:\Academic Friends\Dingyuan Accounting 202502\report".

replace allows overwriting existing output files. If specified, the command
will replace any existing log file and output datasets. Without this option,
the command will append to existing log files.

Required Data File

The Excel file must contain four sheets with the following data:

1. Sheet1 - Contains industry codes, total assets (at), net income (ni), and revenue (revenue)

2. Sheet2 - Contains cash flow from operating activities (cfo)

3. Sheet3 - Contains receivables (rec) and fixed assets data

4. Sheet4 - Contains net fixed assets (ppe); only consolidated statements (type "A") are used

Variables Created

The command creates the following key variables in the output dataset:

stkcd - Stock code identifier

year - Year

ta_at - Total accruals scaled by lagged total assets

nda_at - Non-discretionary accruals scaled by lagged total assets

da_at - Discretionary accruals scaled by lagged total assets (earnings management measure)

alpha0, alpha1, alpha2 - Estimated coefficients from the Modified Jones Model

year_ind - Year-industry group identifier

Output Files

The command generates the following output files in the outputfolder:

em_results.dta - Main Stata dataset with all calculated variables and results

earnings_management_analysis.log - Detailed log file of the analysis process

descriptive_stats_variables.rtf - Descriptive statistics for all model variables

descriptive_stats_em.rtf - Descriptive statistics for earnings management measures

jones_model_regression.rtf - Example regression results from one year-industry group

Remarks

The Modified Jones Model is estimated separately for each year-industry group
to account for temporal and sectoral variations in accrual patterns. The model
is specified as:

TA/AT_ = α₀(1/AT_) + α₁(ΔREV/AT_) + α₂(PPE/AT_) + ε

where TA is total accruals, AT is total assets, ΔREV is change in revenue,
and PPE is property, plant, and equipment.

Examples

Basic usage with default file:

. em

Specify custom data file:

. em using "C:/myproject/data/rawdata.xlsx"

Specify custom folders:

. em, datafolder("C:/myproject/data") outputfolder("C:/myproject/results")

Overwrite existing files:

. em, replace

Combine custom file with replace option:

. em using "C:/myproject/data/rawdata.xlsx", replace

Stored Results

The command stores the main results in the dataset saved as em_results.dta.
Additionally, it generates RTF tables with descriptive statistics and
regression results.

Authors

Wu Lianghai

School of Business, Anhui University of Technology (AHUT), Ma'anshan, China

Email: agd2010@yeah.net

Wu Hanyan

School of Economics and Management, Nanjing University of Aeronautics and Astronautics (NUAA), China

Email: 2325476320@qq.com

Liu Rui

School of Business, Anhui University of Technology (AHUT), Ma'anshan, China

Email: 3221241855@qq.com

Yang Lu

Finance Bureau of Rugao City, Nantong City, Jiangsu Province, China

Email: 1026835594@qq.com

Acknowledgments

We sincerely appreciate Christopher F. Baum for his prompt guidance and revision suggestions.

Reference

Dechow, P. M., Sloan, R. G., & Sweeney, A. P. (1995). Detecting earnings management.
The Accounting Review, 70(2), 193-225.

Also see

Manual: import excel, statsby, xtset, egen