help for ccgi

Title

ccgi -- China Corporate Governance Index (CCGI)

Syntax

ccgi varlist [if] [in] ,
reverse(varlist) (may be abbreviated rev())
[winsor(p1 p2)] (may be abbreviated w())
[missing(method)] (may be abbreviated m())
[replace] (may be abbreviated rep)
[exportdta(filename)] (may be abbreviated expd())
[exportexcel(filename)] (may be abbreviated expe())

Description

ccgi constructs the China Corporate Governance Index (CCGI) using 12
governance indicators with equal weights. The program automatically performs
Min-Max normalization and distinguishes between forward and reverse indicators.
All variables are assigned descriptive labels.

After running ccgi, the dataset remains in memory with all original
variables, normalized variables (prefixed with "n_"), and the newly created
ccgi_index variable, allowing for further analysis.

Options

reverse(varlist) (may be abbreviated rev()) specifies the
list of reverse indicators. Variables not listed are treated as forward indicators.

Reverse indicator normalization: (max - x)/(max - min)

Forward indicator normalization: (x - min)/(max - min)

winsor(p1 p2) (may be abbreviated w()) performs
winsorization at the specified percentiles. This option MUST include two
percentiles. Examples:

winsor(1 99) (1st and 99th percentiles)

winsor(2 98) (2nd and 98th percentiles)

winsor(0.5 99.5) (0.5th and 99.5th percentiles)

p1 and p2 must be numbers with p1 < p2. Winsorization is applied
before normalization. Binary variables (0/1 or only two distinct values) are
automatically skipped and a message is displayed.

By default, if winsor() is not specified, no winsorization is performed.

missing(method) (may be abbreviated m()) handles missing
values in the 12 governance indicators. Available methods:

missing(drop) - Drop observations with any missing values

missing(mean) - Impute missing values with variable means

missing(median) - Impute missing values with variable medians

missing(zero) - Impute missing values with zeros

If this option is not specified, the program will use the data as is, and any
missing values will result in missing CCGI scores (since rowmean returns missing
if any component is missing).

replace (may be abbreviated rep) allows overwriting existing DTA or
Excel files. Without this option, the program will issue an error if output
files already exist.

exportdta(filename) (may be abbreviated expd()) saves the
dataset (including original variables, normalized variables, and CCGI) as a
Stata DTA file. The dataset remains in memory after saving, allowing you to
continue your analysis without reloading the data.

exportexcel(filename) (may be abbreviated expe()) exports
the same dataset to an Excel file with variable names in the first row. The
dataset remains in memory after export, allowing for seamless workflow integration.

Tip: You can use both exportdta() and exportexcel() together
in the same command to save both file formats simultaneously while keeping the
data in memory for immediate use.

Remarks

1. Exactly 12 variables must be provided. The order of variables does not matter.

2. If an indicator has no variation across observations (min = max), it is set
to 0.5 after normalization with a warning message.

3. Missing values can be handled automatically using the missing() option.
If not handled, observations with any missing values will have missing CCGI scores.

4. Winsorization uses Stata's _pctile command. Binary variables (e.g.,
dual_role, audit_committee) are automatically excluded from winsorization.
No winsorization is applied unless winsor(p1 p2) is explicitly specified.

5. Normalized variables are renamed with prefix "n_" (e.g., n_board_size)
and given descriptive labels.

6. After running ccgi, the dataset remains in memory. All original variables,
normalized variables, and the ccgi_index are available for further analysis.

7. The program returns the following scalars:

r(mean_ccgi) - Mean of CCGI

r(sd_ccgi) - Standard deviation of CCGI

r(min_ccgi) - Minimum value of CCGI

r(p25_ccgi) - 25th percentile of CCGI

r(median_ccgi) - Median of CCGI

r(p75_ccgi) - 75th percentile of CCGI

r(max_ccgi) - Maximum value of CCGI

Examples

* Example 1: Basic usage without winsorization

ccgi board_size indep_ratio mgt_share top1_share top5_share top10_share meeting_freq audit_committee dual_role salary disclosure_quality ipo_year, reverse(top1_share dual_role) exportdta(ccgi_result.dta)

* Example 2: With winsorization at 1st and 99th percentiles

ccgi board_size indep_ratio mgt_share top1_share top5_share top10_share meeting_freq audit_committee dual_role salary disclosure_quality ipo_year, rev(top1_share dual_role) winsor(1 99) rep expd(ccgi_result.dta)

* Example 3: Custom winsorization (2% and 98%) with replace

ccgi board_size indep_ratio mgt_share top1_share top5_share top10_share meeting_freq audit_committee dual_role salary disclosure_quality ipo_year, rev(top1_share dual_role) w(2 98) rep

* Example 4: With sample restriction and missing value handling

local g_vars "board_size indep_ratio mgt_share top1_share top5_share top10_share meeting_freq audit_committee dual_role salary disclosure_quality ipo_year"

ccgi `g_vars' if year==2025, rev(top1_share dual_role) winsor(0.5 99.5) missing(median) rep expd(ccgi_2025.dta)

* Example 5: Export both DTA and Excel simultaneously

ccgi `g_vars', rev(top1_share dual_role) winsor(1 99) rep expd(ccgi_result.dta) expe(ccgi_result.xlsx)

* Example 6: Run CCGI and continue analysis (data remains in memory)

ccgi `g_vars', rev(top1_share dual_role) winsor(1 99)

summarize ccgi_index

gen ccgi_above_median = ccgi_index > r(median_ccgi)

* Example 7: Using returned scalars

ccgi `g_vars', rev(top1_share dual_role) winsor(1 99)

return list

gen ccgi_centered = ccgi_index - r(mean_ccgi)

Required Variables

The following 12 variables must be present in the dataset:

board_size - Board size (number of directors)

indep_ratio - Proportion of independent directors (%)

mgt_share - Management shareholding ratio (%)

top1_share - Largest shareholder ownership (%)

top5_share - Top5 shareholders ownership (%)

top10_share - Top10 shareholders ownership (%)

meeting_freq - Board meeting frequency (times per year)

audit_committee - Audit committee existence (1=yes, 0=no)

dual_role - CEO duality (1=CEO is Chair, 0=no)

salary - Executive compensation (log or level)

disclosure_quality - Information disclosure rating

ipo_year - Years since IPO (or IPO year)

Option Abbreviations

The following abbreviations are supported:

reverse() can be abbreviated as rev()

winsor() can be abbreviated as w()

missing() can be abbreviated as m()

replace can be abbreviated as rep

exportdta() can be abbreviated as expd()

exportexcel() can be abbreviated as expe()

Forward vs Reverse Indicators

Forward indicators: Higher values indicate better corporate governance
(e.g., board independence, meeting frequency, disclosure quality)

Reverse indicators: Lower values indicate better corporate governance
(e.g., largest shareholder ownership, CEO duality)

Other Commands I Have Written

mysuite (if installed) ssc install mysuite (to install)

mysuite provides a collection of utility commands for data management,
regression diagnostics, and result export. See mysuite for details.

Also see

Help: winsor2, egen, collapse, export, return,
winsor, trimmean

Version History

Version 3.6 (11 June 2026):

- Fixed exportdta() and exportexcel() to properly save files
while keeping data in memory

- Added confirmation message "Data remains in memory for further analysis"

- Improved Excel export to preserve memory state using temporary files

Version 3.5 (11 June 2026):

- Winsorization now requires explicit percentiles

- Added warning for missing values handling

Version 3.0-3.4:

- Initial public releases with basic CCGI functionality

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)

Nanjing, China

Email: 2325476320@qq.com

Development Date: 11 June 2026