*! version 1.7 30Nov2025

help euiEnvironmental Uncertainty Index Calculator

Title

eui - Environmental Uncertainty Index Calculator

Compute environmental uncertainty index using industry sales growth rate standard deviation

Syntax

eui [using filename], WINDow(integer)
[MISsing(string) SAVing(filename) REPLACE]

Required
WINDow(integer) time window for standard deviation calculation (3-5 years)

Optional
using specify Excel data file path

MISsing(string) missing value treatment method: drop or ipolate

SAVing(string) save results to specified file

REPLACE overwrite existing files

Description

eui calculates the Environmental Uncertainty Index (EUI) using the standard deviation
of industry sales growth rates over a specified time window (3-5 years). The program
implements a comprehensive data processing pipeline including data cleaning, industry
classification, growth rate calculation, and uncertainty measurement.

Version Information: Version 1.7 - 30 Nov 2025

The algorithm follows these steps:

1. Data Import: Loads data from Excel file with variables stkcd, date, code, revenue

2. Data Cleaning: Removes duplicates, handles missing values, creates year variable, and processes industry code missing values

3. Industry Classification: Creates industry codes based on classification rules

4. Aggregation: Computes total sales by industry and year

5. Growth Calculation: Calculates sales growth rates

6. EUI Computation: Computes rolling standard deviation of growth rates

7. Output: Provides comprehensive descriptive statistics and visualizations

Options

Required

WINDow(integer) specifies the time window (in years) for calculating the rolling
standard deviation of sales growth rates. Must be an integer between 3 and 5.

Optional

using specifies the path to the Excel file containing the input data. If not specified,
the program looks for "sales.xlsx" in the current directory.

MISsing(string) specifies how to handle missing revenue values. drop removes
observations with missing revenue (default). ipolate uses linear interpolation to fill
missing values.

SAVing(filename) saves the final dataset with EUI values to the specified file.

REPLACE allows overwriting existing files when saving results.

Examples

Basic usage with default settings

. eui, window(3)

Specify data file and 4-year window

. eui using "sales_data.xlsx", window(4)

Full parameter specification with interpolation

. eui using "sales.xlsx", window(5) missing(ipolate) saving("eui_results.dta") replace

Display version information

. eui_version

Authors

Wu Lianghai

School of Business, Anhui University of Technology(AHUT)

Ma'anshan, China

agd2010@yeah.net

Wu Hanyan

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

Nanjing, China

2325476320@qq.com

Chen Liwen

School of Business, Anhui University of Technology(AHUT)

Ma'anshan, China

2184844526@qq.com

Acknowledgements

We gratefully acknowledge Christopher F. Baum for his generous support to Dingyuan Accounting.

References

Methodological References

Baum, C. F. 2006. An Introduction to Modern Econometrics Using Stata. College Station, TX: Stata Press.

Baum, C. F. 2016. An Introduction to Stata Programming. College Station, TX: Stata Press.

Ghosh, D., and Olsen, L. 2009. Environmental uncertainty and managers' use of discretionary accruals.
Accounting, Organizations and Society 34(2): 188-205.

Tosi, H., Aldag, R., and Storey, R. 1973. On the measurement of the environment:
An assessment of the Lawrence and Lorsch environmental uncertainty subscale.
Administrative Science Quarterly 18(1): 27-36.

Dess, G. G., and Beard, D. W. 1984. Dimensions of organizational task environments.
Administrative Science Quarterly 29(1): 52-73.

Methodology Background

The Environmental Uncertainty Index (EUI) methodology is based on the standard deviation
of industry sales growth rates over a rolling time window, following established practices
in strategic management and accounting research. This approach has been widely adopted
in the literature to measure environmental uncertainty, building on foundational work
in organizational theory and strategic management.

Data Processing Details

Input Variables:

- stkcd: Stock code identifier

- date: Year of observation (original)

- code: Industry classification code (string)

- revenue: Sales revenue

Generated Variables:

- year: Numeric year variable derived from date

- industry: Industry classification code

- eui: Environmental Uncertainty Index

Industry Classification Rules:

- If first character of code is "C": industry = first 2 characters

- Otherwise: industry = first character

Missing Value Handling:

- Industry codes: Missing values (empty, "NA", "N/A") are filled using the most frequent code for each company from other years

- Revenue: Missing values are either dropped or interpolated based on user selection

- Observations with unclassified industries are removed

EUI Calculation Method

The Environmental Uncertainty Index is calculated using the following methodology:

1. Industry Aggregation: Total sales revenue is calculated for each industry-year combination

2. Growth Rate Calculation: Sales growth rates are computed for each industry using year-to-year changes

3. Rolling Standard Deviation: The EUI is computed as the standard deviation of sales growth rates over a rolling time window

4. Window Requirement: At least window years of consecutive data are required to compute EUI for a given year

Important Note on Recent Years:

Due to the rolling window requirement, the most recent years in the dataset may not have EUI values calculated.
For example, with a 5-year window, EUI values will only be available for years where there are at least 5 consecutive years
of data including that year.

Diagnostic Information

The program provides comprehensive diagnostic information throughout the calculation process:

- Year range of input data

- Industry classification results

- Missing value handling statistics

- EUI calculation progress by industry

- Final years with available EUI values

Statistical Output

The program generates comprehensive statistical reports including:

1. Overall EUI Statistics: Detailed summary statistics for the complete dataset

2. Industry-level Statistics: EUI statistics aggregated by industry, showing mean,
standard deviation, minimum, maximum, and observation count for each industry.

Visualizations

The program generates the following graphical outputs:

- EUI Distribution Histogram: Shows the frequency distribution of EUI values

- Box Plot by Industry: Compares EUI distributions across different industries

- EUI Trend by Industry: Line charts showing how EUI evolves over time for each industry

Limitations and Considerations

Data Requirements:

- At least window+1 years of data are needed to calculate the first EUI value (due to growth rate calculation)

- Recent years may not have EUI values if insufficient data is available for the rolling window

- Industry classification requires valid industry codes for all observations

Interpretation:

- Higher EUI values indicate greater environmental uncertainty

- EUI values are comparable within the same industry over time

- Cross-industry comparisons should consider industry-specific characteristics

Also see

Manual: import excel, collapse, ipolate, merge, tabstat

To display version information: eui_version