Q-Factor Model of Hou, Xue, and Zhang (2015)
The Q-factor model of Hou, Xue, and Zhang (2015) is based on the q-theory of investment. This model proposes that the expected return of an asset in excess of the risk-free rate is described by the sensitivities of its returns to 4 factors: the market excess return, the difference between the return on a portfolio of small size stocks and the return on a portfolio of big size stocks, the difference between the return on a portfolio of low investment stocks and the return on a portfolio of high investment stocks, and the difference between the return on a portfolio of high proﬁtability stocks and the return on a portfolio of low proﬁtability stocks.
Our Stata Code
We have developed codes in the Stata language for constructing the risk factors and for testing the model. Specifically, the code performs the following activities.
- Importing different files from Excel
- Reshaping the data to a long format
- Merging different datasets
- Forming 18 portfolios by taking the intersections of the 2 size, 3 I/A (investment), and 3 ROE groups. Then monthly value-weighted portfolio returns are calculated.
- Factors are then constructed from these 18 portfolios.
- To test the model, 25 portfolios are then developed from the intersection of size and book-to-market
ratio. Excess returns on these portfolios are then used as dependent variables.
- Time-series regressions are then estimated by regressing the LHS 25-portfolios returns
on the 4 factors.
- Result tables are constructed in Excel using the commonly used format of Fama and French papers.
- GRS-tests can be optionally added to the above at a fee of $50. Besides the GRS tests, we also provide various statistics on model performance, for details of these statistics, please see Table 5 of Fama and French (2015).
Are comments included?
We have developed easy to use yet robust codes for the above steps. The codes need just a basic understanding of Stata. Further, our comments on each line of code will surely help you in running the code as well as in understanding the process more clearly. We normally share all Stata files, the raw data files, and Stata codes with comments. The purpose is to help researchers to learn and apply these codes on their own. We also try to answer questions that might arise at a later stage when the researcher applies these codes.
The code is available with three options (see details in the following table).