Category Archives: Blog

  • 1

Dropping i.dummies from regression | asdoc | Word | Stata

Category:asdoc,Blog,Stata Programs Tags : 

Questions: I have time and location dummies which I want to include in the regression, but do not want to report them in the regression nested tables created with asdoc. How can I do that?

If you have not already installed asdoc, you can install it from SSC by typing the following in the Stata command window:

ssc install asdoc

Let’s use an example data set.

use http://fintechprofessor.com/regdata.dta, clear

This dataset has four main independent variables, named as x1, x2, x3, x4 and a set of possible dummy variables that will be constructed from the variable year (from 2001-2005) and location (from 1-3).  Let us estimated the following regression:

asdoc reg y x1 x2 x3 i.year i.location, nest drop(i.year i.location) replace

asdoc reg y x1 x2 x4 i.year i.location, nest drop(i.year i.location)

Explanations

In the above two lines, we have estimated two regressions and sent their output to a Word file.  In the first line, we estimated a regression with the three main independent variables x1, x2, and x3 and included the year and location dummies on the fly. The option nest will create a nested regression table. The option drop(i.year i.location) drops these dummy variables from the regression table, however, they are included in the main regression. The two lines produce the following regression table in MS Word. 


  • 0

Exporting tabs and cross-tabs to MS Word from Stata with asdoc

Category:Blog Tags : 

For installation and other uses of asdoc, please see this short blog post.

Tabulation and Cross-tabs with asdoc

Exporting tables created by Stata commands such as tab, tabulate1, tabulate12, table, tabsum, tab1, tab2, and others to MS word is super easy with asdoc.  As with other commands, we need to just add asdoc as a prefix to the tabulation commands that includes tabulate, tabulate1 tabulate2, tab1, tab2, etc. Since frequency tables in Stata can assume different structures, asdoc writes these tables from log files.

 

One-way table

Example: One-way table

sysuse auto, clear 
asdoc tabulate rep78, replace

 

Please note that replace is asdoc option to replace the existing file. If we were to write to the existing file, we would then use option append, instead of replace.

 

Two-way table of frequencies

 

webuse citytemp2, clear

asdoc tabulate region agecat, replace

 

Example: Include row percentages

 

asdoc tabulate region agecat , nokey row replace

Note nokey suppresses the display of a key above two-way tables.

 

Example: Include column percentages

asdoc tabulate region agecat , nokey column replace

 
Example: Include row percentages, suppress frequency counts

asdoc tabulate region agecat, nokey row nofreq replace

 

One- and two-way tables of summary statistics

Example: One-way tabulation with summary statistics

 

sysuse auto, clear
asdoc tabulate rep78, summarize(mpg) replace

 

Example: Two variables tabulation with summary statistics

generate wgtcat = autocode(weight, 4, 1760, 4840)

asdoc tabulate wgtcat foreign, summarize(mpg) replace

 

Example: Suppress frequencies

asdoc tabulate wgtcat foreign, summarize(mpg) nofreq replace

 

Multiple-way tabulation (tab1)

tab1 produces a one-way tabulation for each variable specified in varlist.

Example: Multiple-way tabulation

sysuse nlsw88, clear
asdoc tab1 race married grade, replace

 

Two-way for all possible combinations (tab2)

Example: Two variables tabulation with summary statistics

asdoc tab2 race south, replace

  • 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


  • 0

Find annual | monthly cumulative (product) of returns

Category:Blog Tags : 

The problem


Let’s say that we have daily stock returns. We want to convert those returns to cumulative returns for a weekly, monthly or yearly frequency.

Where cumulative returns = (1+Ri1) * (1+Ri2) * (1+R3) * … (1+R4) – 1

 

Solution

First create the weekly, monthly or year identifier, and then use asrol program.

Let us use this data set [Click here to download], also shown below and find returns for different frequencies.

input id str20 D returns
 1 30jun1993 .7437958 
 1 02jul1993 .0674011 
 1 06jul1993 .2668857 
 1 14jul1993 .0454151 
 1 19jul1993 .1340756 
 1 29jul1993 .8053644 
 1 13aug1993 .5861199 
 1 24sep1993 .3200437 
 1 19oct1993 .0098762 
 1 19oct1993 .005197 
end
g date = date(D, "DMY")
drop D

 

Find weekly cumulative returns

Let us first install asrol from ssc

ssc install asrol

Now create weekly date

gen week = wofd(date)

Now find the returns using asrol

bys id week :  asrol returns, stat(product) add(1)

Note : add(1) adds 1 with each returns before multiplication and then subtracts 1 at the end.

Find monthly cumulative returns

gen month = mofd(date)
bys id month:  asrol returns, stat(product) add(1)

Find yearly cumulative returns

 gen year= year(date)
bys id year:  asrol returns, stat(product) add(1)

  • 2

Research Topics in Finance | Financing / Capital Structure Choices

Category:Blog Tags : 

In this blog post, I would like to present a list of research topics related to financing or capital structure decisions.


 Top managers experiences and firms’ capital structure choices

 Do macroeconomic factors affect the choice of debt /equity financing? How are small firms affected?

 Supply of capital and debt-equity choices

 Persistence in capital structure decisions?

4  Can earning timing affect capital structure decisions?

5   Can stock return shocks affect capital structure decisions?

6   Effects of Capital Structure on Cost of Capital

7  judicial efficiency and capital structure: is there a relation?

8   Cultural and religious effects on capital structure choices

9  Credit market imperfections and capital structure changes

10  How corporate governance affect capital structure decisions

11  How financial crisis plays a role in altering capital structures

12  Country tax system and capital structure choices

13  Information asymmetries and capital structure decisions around the world

14  Product market competition and capital structure decisions

15  Capital structure adjustments: Do macroeconomic and business risks matter?

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

17  Competing theories of capital structure: pecking order theory vs trade-off theory

18  Can hedging increase the debt capacity of a firm?

19  Can credit ratings determine firm’s capital structure

20  Diversification and capital structure


  • 5

Rolling window regressions in Stata

Category:Blog Tags : 

Rolling window statistics are also known as sliding or moving window statistics. Rolling window regressions have special use in Finance and other disciplines. Rolling window calculations require lots of looping over observations. The problem is compounded by different data structures such as unbalanced panel data, data with many duplicates, and data with many missing values. Yet, there might be data sets that have both time series gaps as well as many duplicate observations across groups.

 

asreg : A simple and fast solution to rolling window regressions

asreg is a Stata program for estimation of rolling window regressions. To estimate rolling window regressions in Stata, the conventional method is to use the rolling command of Stata. However, that command is too slow, especially for larger data set. asreg is order of magnitude faster than estimating rolling window regressions through conventional methods such as Stata loops or using the Stata’s official rolling command. asreg has the same speed efficiency as asrol. All the rolling window calculations, estimation of regression parameters, and writing the results to Stata variables are done in the Mata language.

 

Why asreg is so fast?

Rolling window calculations require lots of looping over observations. The problem is compounded by different data structures such as unbalanced panel data, data with many duplicates, and data with many missing values. Yet, there might be datasets that have both time series gaps as well as many duplicate observations across groups. asreg does not use a static code for all types of data structures. Instead, asreg intelligently identifies data structures and matches one of its rolling window routines with the data characteristics. Therefore, the rolling window regressions are fast even in larger data sets. asreg writes all regression outputs to the data in memory as separate variables. This eliminates the need for writing the results to a separate file and then merging them back to the data for any further calculations.

 

Installation

asreg can be installed for free by typing the following command in the Stata’s command window:

ssc install asreg

After the installation is complete, we can directly use asreg from the Stata’s command window. Let us use the grunfeld data set from the web and estimate rolling regressions with asreg. To download the dataset, type the following from the Stata command window:

webuse grunfeld, clear

Please note that the word clear after comma tells Stata to unload an existing data set from its memory. So this option has to be used carefully as this might result in losing any unsaved changes to the data set in memory.

 

Example 1: regression in a 10-years rolling window

bys company: asreg invest mvalue kstock, wind(year 10)

Explanation: Let us discuss the components of the code line that we used above for 10-years rolling regressions.

bys company : forces asreg to estimate the rolling regression separately for each company

asreg invest mvlaue kstock : asreg invokes the asreg program. Right after asreg, we have to type the name of the dependent variable, and then the full list of independent variables. Therefore, in our example, the dependent variable is invest, and we have two independent variables, i.e., mvalue and kstock.

, wind(year 10) : After the comma, the program’s optional options are specified. The phrase wind(year 10) tells Stata to use a rolling window of 10 observation, based on the values of the existing variable year.

 

Example 2: Regression for each company in a recursive window

webuse grunfeld

bys company: asreg invest mvalue kstock, wind(year 10) rec

OR

. bys company: asreg invest mvalue kstock, wind(year 1000)

 

Example 3: Using option minimum

. webuse grunfeld

. bys company: asreg invest mvalue kstock, wind(year 10) min(5)

 

Example 4: Reporting standard errors

. webuse grunfeld

. bys company: asreg invest mvalue kstock, wind(year 10) se

 

Example 5: Reporting standard errors, fitted values and residuals

. webuse grunfeld

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

 

Example 6: Reporting Newey-West standard errors with two lags

. webuse grunfeld

. bys company: asreg invest mvalue kstock, wind(year 10) newey(2)

 

See also these related posts


by-group regressions

Fama-MacBeth (1973) regressions

Rolling window regression, rolling windows betas