Author Archives: Attaullah Shah

  • 10

Research topics | Corporate Governance and Disclosure

Category:Blog Tags : 

In this blog post, I would like to present a list of research topics related to corporate governance and disclosure choices. 


 The relevance of good corporate governance practices in family controlled and concentrated ownership environment?

 Corporate governance practices, firms performance, and risk? Are these related?

Market risk disclosures and corporate governance structure

4  How and why an independent audit matters?

5   What determines CSR quantity and quality?

6   Usefulness of annual reports to individual investors.

7  Can board diversity play a role in the disclosure process?

8   How mandatory derivative disclosure policy affect CEO compensation and earning smoothing?

9  Earning management and IRFS adoption

10 The impact of Islamic Financial Services Board Standard No. 3 on corporate governance

11 The perception of financial analysts on risk, risk management, and internal control disclosure

12 The role of ethnic directors in corporate social responsibility: Does culture matter?

13 Corporate governance and intellectual capital reporting in a period of financial crisis

14  Extent and determinants of voluntary disclosure for regulatory purposes

15 The impact of company size and multiple directorships on corporate governance effectiveness

16  The capital structure and investment decisions of the small owner-managed firm

17 Governance indicators as determinants of operational risk

18 Corporate governance, size, and disclosure of related party transactions

19  Social media: New challenges and opportunities for corporate governance

20 The Corporate Gini Index (CGI) determinants and advantages

21  Industry concentration and corporate disclosure policy

22  The Impact of Audit Committee Characteristics on Corporate Voluntary Disclosure

23  Equity home bias and corporate disclosure

24  The impact of news articles and corporate disclosure on credit risk valuation

25  Internet-based corporate disclosure and market value

  • 1

Plotting cumulative average abnormal (CAAR) on a graph in Stata


In Stata, we can use the two-way graph type for plotting abnormal returns or cumulative average abnormal returns against the days of the event window. Suppose that we have event window of 7 days, and have the following data


days caar1 caar2 caar3 caar4
-3 0 0 0 0
-2 -.0043456 -.0050911 .0000683 .0000504
-1 -.0034961 -.0023533 .0037439 .0042783
0 -.0034278 .0019828 .0090661 .0106628
1 .0016178 .0067894 .0131572 .0156011
2 .0039689 .0104367 .0190594 .0221428
3 .0040022 .0129478 .0218878 .0267722

to plot the first caar1, we shall type :

graph twoway line caar1 days, xline(0)


If we were to plot all caars, then

graph twoway line caar* days, xline(0)


  • 33

asdoc : options and examples

Category:asdoc,Stata Programs Tags : 


asdoc sends Stata output to Word / RTF format. asdoc creates high-quality, publication-ready tables from various Stata commands such as summarize, correlate, pwcorr, tab1, tab2, tabulate1, tabulate2, tabstat, ttest, regress, table, amean, proportions, means, and many more.

Using asdoc is pretty easy. We need to just add asdoc as a prefix to Stata commands. asdoc has several built-in routines for dedicated calculations and making nicely formatted tables.

asdoc Options

How to enter asdoc options and Stata_command options?
Both the asdoc options and Stata_command specific options should be entered after comma. asdoc will parse both the option itself. For example,the following command has both types of options.

asdoc sum, detail replace dec(3)

option detail belongs to sum command of Stata, whereas options replace and dec(3) are asdoc options.

Following options are used for controlling the behavior of asdoc:

1.1 Replace / append:

We shall use option replace when an existing output file needs to be replaced. On the other hand, we shall use option append if we want to
append results to the existing file. Both the options are optional. Therefore, if none of these options are used, asdoc will first determine
whether a file with a similar name exists in the current directory. If it exists, asdoc will assume an append option. If the file does not
exist, it will create a new file with the default name “Myfile.doc”

Example 1 : running asdoc without replace or append (first time)

sysuse auto
asdoc sum

The above lines of code will generate a new file with the name Myfile.doc. Next, if we estimate a table of correlation, we can replace the
existing file Myfile.doc or append to it. Again, if we do not use any of these options, option append will be assumed. So;

Example 2 : running asdoc without replace or append (second time)

asdoc cor
asdoc cor, append

Both of the above commands serve the same purpose. The file Myfile.doc will now contain a table of summary statistics, followed by a table ofcorrelations. However, had we typed the following, then the file would contain only table of correlations. asdoc cor, replace

1.2 rowappend:

To develop a table row by row from different runs of the asdoc, we need to use option rowappend. This option can be used with ttest, customized summary statistics, or in other instances where the table headers and structure do not change
and appendable statistics have a similar structure as those already in the table.

1.3 save (file_name):

Option save(file_name) is an optional option. This option is used to specify the name of the output file. If left blank, the default name will
be used, that is Myfile.doc. If .doc extension is not preferred, then option save will have to be used with the desired extension, such as

Example 3 : Naming the output file

asdoc sum, save(summary.doc)
asdoc sum, save(summary.rtf)

1.4 title(table_title)

Option title(table_title) is an optional option. This option is used to specify table title. If left blank, a default table title will be

asdoc sum, save(summary.doc) title(Descriptive statistics)

1.5 Font size i.e. fs(#)

The default font size of asdoc is 10 pt. Option fs(#) can be used to change it. For example, fs(12) or fs(8), etc.

1.6 Decimal points i.e. dec(#)

The default decimal points in many commands are 3. In some commands, the decimal points are borrowed from the Stata output and hence they cannot be changed. In several commands, it is possible to change decimal points with option dec(#). For example, dec(2) or dec(4), etc.

1.7 Adding text lines to the output file i.e. text(text lines)

We can write text to our output file with option text(text lines). This is useful when we want to add details or comments with the Stata
output. In fact, this option makes asdoc really flexible in terms of adding tables and paragraph at the same time. We never have to leave the
Stata interface to add comments or interpretation with the results. One trick that we can play is to use option fs() to change font size and
mark headings and sub-headings in the document. Consider the following examples [I have copied some text from for this example]

1. Write a heading "Details on Cars" in our document
asdoc, text(Details on Cars) fs(16) replace

2. Now add some text

asdoc, text(A car is a wheeled motor vehicle used for transportation) append fs(10) 
asdoc, text(Most definitions of car say they run primarily on roads, seat one ) append fs(10) asdoc, text(to eight people, have four tires, and mainly transport people.) append fs(10)

3. Now add some statistics

sysuse auto, clear
asdoc sum, append fs(10)

1.8 Hide Stata output with option hide

We can suppress Stata output with option hide. It is important to mention that option hide might not work with some of the Stata commands (asdoc creates output from log files in some cases).

1.9 Getting Stata commands in output files (cmd)

If we need to report the Stata command in the output file, we can use the option cmd.

1.10 Abbreviate variable names with option (abb(#))

In case variable names are lengthy, they can be abbreviated in the output file with option abb(#). For example, abb(8). In many cases, the
default value is 10. However, when option label is used, this value is set to = abb + 22

1.11 Report variable labels with option (label)

Several commands allow reporting variable labels instead of variable names. For example, the most commonly used commands for reporting statistics are correlate and summarize. Both of these commands allow option label. For example :

asdoc cor, label
asdoc sum, label

1.12 Always report equal decimal points (tzok)

The default for report decimal points is to drop trailing zeros and report only valid decimal points. However, we can use the option tzok
i.e. trailing zeros OK, to report equal decimal points for all values even if the trailing values are zero. Therefore, using option
dec(4) for reporting 4 decimal points, the value 2.1 will be reported as follows with and without option tzok.

Default style 2.1
with tzok option 2.1000

  • 6

Rolling regressions, beta, t-statistics, and SE in Stata


asreg can easily estimate rolling regressions, betas, t-statistics and SE in Stata. To understand the syntax and basic use of asreg, you can watch this Youtube video. In this post, I show how to use asreg for reporting standard errors, fitted values, and t-statistics in a rolling window.

To install asreg, type the following on the Stata command window

ssc install asreg


Report standard errors and fitted values 

We shall use the grunfeld data set for our examples. Using a rolling window of 15 observations, let us fit a regression model where our dependent variable is invest and independent variables are mvalue and kstock. We shall estimate the rolling regression separately for each company, therefore, we shall use the prefix bys company : 

Please note that option se and fit are used for reporting standard errors and fitted values, respectively.

webuse grunfeld, clear

bys company: asreg invest mvalue kstock, wind(year 15) fit se


Find t-statistics in the rolling window

Once we have the standard errors and coefficients, we can generate t-statistics by dividing respective coefficients on their standard errors. Therefore, to find t-values for the variable mvalue and kstock, we can generate new variables:

gen t_mvalue = _b_mvalue / _se_mvalue

gen t_kstock = _b_kstock / _se_kstock

  • 68

Publication quality regression tables with asdoc in Stata – video example

Category:asdoc Tags : 

Creating publication-quality tables in Stata with asdoc is as simple as adding asdoc to Stata commands as a prefix. asdoc can create two types of regression tables. The first type (call it detailed) is the detailed table that combines key statistics from the Stata’s regression output with some additional statistics such as mean and standard deviation of the dependent variable etc. This table is the default option in asdoc. The second table is a compact table that nests more than one regressions in one table (call it nested).

In this video post, I show how to use asdoc to produce the following nested table. 



  • 44

How to export high-quality table of correlations from Stata to MS Word

Category:asdoc Tags : 

For creating a high-quality publication-ready table of correlations from Stata output, we need to install asdoc program from SSC first.

ssc install asdoc, update

Once the installation is complete, we shall add the word asdoc to the cor command of Stata. Since we estimate correlations among all numeric variables of a dataset by typing cor in Stata, we shall add asdoc as a prefix to the cor command. Let us load the auto.dta data from the Stata example files.


Example 1: Make a table of correlation for all variables.

sysuse auto, clear
asdoc cor


Example 2: We can report variable labels instead of variable names

asdoc cor, label replace

Further, it is possible to write names of the variables in the column headings instead of sequential numbers. For this, we shall invoke the option nonum. Therefore, see example 3.


Example 3: Write variable names in column headers

sysuse auto, clear

asdoc pwcorr, nonum replace

Read also : 

Table of contents of asdoc

Generate a correlation table with significance/stars

Generate a table of descriptive statistics

Generate a table of customized descriptive statistics

  • 58

How to use asdoc : a basic example

Category:asdoc Tags : 

Using asdoc is pretty easy. You need to add just asdoc as a prefix to Stata commands. For example, we use the sum command to find summary statistics of all numeric variables in the dataset. We shall add just asdoc as a prefix to sum.  Let us load the auto.dta set for practice and find summary stats of all numeric variables and send the output to MS Word with asdoc

sysuse auto
asdoc sum

And voila, a beautiful table of the descriptive statistic is ready [click here to see it].

And for creating a table of correlations among all numerical variables, we shall just type asdoc cor. If we were to append the results to the same file, we shall add append after the comma or leave it (append is the default, we  can use replace to replace the existing file)

asdoc cor
asdoc cor, append

More on asdoc

See also the following resources related to asdoc.

YouTube Video: Descriptive / Summary Statistics from Stata in Word with asdoc

YouTube Video: Create a publication quality table of correlation in Stata with asdoc

YouTube Video: Writing all statistics to a single Word file from Stata with asdoc

YouTube Video: Create publication quality regression tables in Stata with asdoc

See a Table of Contents that shows what else asdoc can do

asdoc : Sends Stata output to MS Word

Category:asdoc,Stata Programs

About asdoc

asdoc is a Stata program that makes it super-easy to send output from Stata to MS Word. asdoc creates high quality, publication-ready tables from various Stata commands such as summarize, correlate, tabstat, cross-tabs, regressions, t-tests, flexible table, and many more.


The program can be installed by typing the following from the Stata command window:

ssc install asdoc, update

Table of contents

1. Introduction

1.1 asdoc: short introduction and examples
1.2 Commands for controlling asdoc


2. Summary Statistics

2. Summary statistics
2.1 Basic summary statistics
2.2 Customized summary statistics


3. Correlations

3.1 Correlations [Blog Post]
3.2 Correlations [YouTube Video]
3.3 Correlations with significance stars


4. Regressions

       4.1 Full regression tables [YouTube Video]

4.1.1 Customizing the detailed table: Stars and CIS
4.2 Compact / nested tables (publication quality)
4.3 Regression over a grouping variable (YouTube Video)
4.4 Changing order of variables in the nested regression table


5. Frequency tables

5.1 One-way tabulation (tabulate1)   Watch YouTube Video
5.2 Two-way tabulation (tabulate2) Watch YouTube Video
5.3 One- and two-way tables of summary statistics (tabsum)
5.4 Multiple-way tables (tab1)
5.5 All-possible two-way tables (tab2)


6. Compact tables (tabstat)

6.1 Without groups
6.2 With groups


7. Flexible table of statistics (table)

7.1 One-way table
7.2 Two-way table
7.3 Three-way table
7.4 Four-way table


8. T-tests

8.1 one-sample t-test
8.2 two-sample using groups
8.3 two-sample using variables
8.4 paired t-test


9. Table of means, std., and frequencies (tabsum)

10. Means
10.1 Arithmetic / harmonic / geometric means
10.2 Proportions
10.3 Ratio
10.4 Total

11. Exporting the Stata Data with the sub-command list 

12. Writing matrix to a Word / RTF file

13.The survey prefix command

14.Customized tables with option row

15.Customizing Table Titles – Tips and Tricks

  • 0

Log vs simple returns: Examples and comparisons

Category:Uncategorized Tags : 

Simple vs log returns | Conversion from daily to other frequencies

MS Excel Example 

[Download Example]

In the following table, we have data from 1/1/2010 to 1/7/2010.  The first column has firm id; the second column has date; the third column has stock prices.

id date prices simple ri log_ri ri+1
1 1/1/2010 70
1 1/2/2010 72 2.857% 2.817% 102.857%
1 1/3/2010 75 4.167% 4.082% 104.167%
1 1/4/2010 73 -2.667% -2.703% 97.333%
1 1/5/2010 74 1.370% 1.361% 101.370%
1 1/6/2010 76 2.703% 2.667% 102.703%
1 1/7/2010 77 1.316% 1.307% 101.316%

The fourth and fifth columns have simple and log returns, calculated as:

simple ri = (Price[i] - Price[i-1] ) /  Price[i-1]  --- (Eq. 1)
log ri = ln( Price[i]  /  Price[i-1]  --- (Eq. 2)

where Price[i] is the stock price in the current period,  Price[i-1] is the stock price in the previous period, ln is the natural log. To convert simple returns to n-period cumulative returns, we can use the products of the terms (1 + ri) up to period n. Therefore, the fifth column adds a value of 1 to the simple period returns.

Weekly cumulative simple returns

Suppose we wish to find weekly cumulative simple returns from the stock prices, we shall just use the first and the last stock prices of the week and apply equation (1). Therefore, our cumulative weekly simple return is as follows:

weekly simple ri = ( 77 - 70) /  70 = 10.00%

And if we were to find weekly cumulative simple returns from the daily returns, then we would add 1 to each of the period simple_ri, find its product, and deduct 1 at the end. Therefore, the formula for converting simple periodic daily returns to weekly cumulative returns would be :

Cumulative n-period simple returns =

(1+simple_r1) * (1+simple_r2) *(1+simple_r3)
  ... (1+simple_rn- 1     --- (Eq. 3)

Therefore, applying Equation 3 to our example;

Cumulative weekly simple returns =
102.857% * 104.167% * 97.333% * 101.370% * 102.703% 

* 101.316% - 1 = 10.00%


Weekly cumulative log returns

Now suppose we wish to find weekly cumulative log returns from the stock prices, again we shall use the first and the last of the stock prices of the week in equation (2). So, our cumulative weekly log return is as follows:

weekly log ri = ln( 77 /  70) = 9.53%

Since log returns are continuously compounded returns, it is normal to see that the log returns are lower than simple returns. To find n-period log returns from daily log returns, we need to just sum up the daily log returns. Therefore :

Cumulative weekly simple returns2.817% + 4.082% +  (-2.703%) + 
1.361% +2.667% +  1.307% = 9.53%



Stata Example

We shall continue to use the same data as above. The Stata do file for all of the following steps can be downloaded from here.

The following lines of code will generate the required data

input float date byte(id prices) float wofd
18263 1 70 2600
18264 1 72 2600
18265 1 75 2600
18266 1 73 2600
18267 1 74 2600
18268 1 76 2600
18269 1 77 2600
format %td date
format %tw wofd
tsset id date

Now to generate simple and log returns

bys id (date) : gen simple_ri = (price / L.price) -1
bys id (date) : gen log_ri = ln(price / L.price)


Cumulative weekly simple returns

we shall use ascol program. This program can be downloaded from SSC by typing:

ssc install ascol

If daily returns were calculated with Eq. 1 above (i.e. simple returns) and they needed to be converted to cumulative n-periods returns, we shall use the option returns(simple). For this purpose, we would type the following command:

ascol simple_ri, returns(simple) keep(all) toweek

For syntax and option details of ascol, you can type help ascol at the Stata command prompt. We shall just briefly list the option used in the above command. After typing ascol, we need to mention the name of the variable for which cumulative returns are needed.

In our case, it is the simple_ri. Then after the comma, we invoke various program options. Our first option is returns(simple), which tells ascol that our data have simple returns. ascol will apply product method of converting from daily to weekly see Eq. 3 above ).  Then we use keep(all)  to stop ascol from collapsing the data set to a weekly frequency. Absent this option, the data will be reduced to one observation per ID and weekly_period identifier.  The other possibility in this regard is the option price, which can be used if the variable is stock prices.  And finally, we used toweek option for converting the data to a weekly frequency. Other possible options in this regard are tomonth, toquarter, and toyear.

Cumulative weekly log returns

If daily returns were calculated using Eq. 2 above  (i.e. log returns) and they need to be converted to cumulative n-periods returns, we shall use the option returns(log). For this purpose, we would type the following command:

 ascol log_ri , returns(log) keep(all) toweek gen(log_cumRi)

The syntax details remain the same as given above. We have used one additional option gen(log_cum) for naming the new variable as log_cumRi

date wofd simple_ri log_ri week_s~i log_cumRi
01jan2010 2010w1 . . .1 .09531018
02jan2010 2010w1 .0285714 .0281709 .1 .09531018
03jan2010 2010w1 .0416667 .040822 .1 .09531018
04jan2010 2010w1 -.0266667 -.0270287 .1 .09531018
05jan2010 2010w1 .0136986 .0136057 .1 .09531018
06jan2010 2010w1 .027027 .0266682 .1 .09531018
07jan2010 2010w1 .0131579 .0130721 .1 .09531018

  • 0

Stata Dates: Conversion from one format to another


Case 1: From String to Stata format

This blog post discusses the conversion of text into Stata date. Once you have read this post, then you can read another post that lists a quick table of dates conversions from one frequency to another. Usually, when we import data manually into the Stata Editor, the dates are shown in string format. For example, Nov202011, November202011, or  etc. We can use the gen command with date function

gen newdate = date(oldDate, "MDY")

Case 2: From daily to monthly

gen monthly = mofd(daily_date)

Case 3: From daily to weekly

gen monthly = wofd(daily_date)

Case 4: From daily to quarterly

gen monthly = qofd(daily_date)

Case 5: From daily to yearly

gen monthly = year(daily_date)

Case 6: From monthly to daily

If our date is recorded in monthly numeric format such as 2001m1, 2001m2, etc, then:

gen daily = dofm(monthly_date)