I would like to conduct a study where I build a factor model based on the characteristics/variables I have collected about firms, using a couple of countries.

I have acquired two Excel data files from CompuStat :

  1. Monthly index prices (MSCI WORLD INDEX) (1950-2017)

  2. Monthly financial statement data (like P / E ratio, B / P ratio) of different firms over the period 1950-2017. The companies all have a company key (GVKEY) as a filter option in Excel.

So I think I first need to merge the data based on the GVKEY and date. That would not be any problem, but the main problems are:

  • Some companies do not have values ​​for one or more variables at certain time points and not all firms have the time period 1950-2017, some start at 1993 for example.

Does anyone have any suggestions of how to deal with the problem and merging the data and how I can conduct my study? Does someone have a step-by-step plan or something for me?

Could this task be as simple as regressing average returns for a stock with its different factors? I heard that I need to do something with creating risk factors through regressions, making portfolio's and sorting on characteristics and using something like a fama-macbeth regression. The problem is that I do not know the hard-programming to figure out how to construct portfolio's etc..

I'd be grateful for any help, I want to use STATA!


1 Answer 1


Replicating Fama & French 2014 model will require some programming language knowledge, to save time.

Major steps includes:

  • Data cleaning & handling missing data
  • Creating portfolio compositions (SMB, HML, RMW, CMA) for each period
  • Computing portfolio returns for each period
  • Compute stock exposures (betas) to each factor (the regression of stock's excess returns against portfolio excess returns)
  • Interpret results

You will also need to have stock returns datasets, the risk-free rate and local equity market index for the target market.

The fundamental data will be used to create the portfolios. Missing data will always exists as companies enters and leaves the market all the time, but it may happens also due to delays in financial statement releases and other issues. if data is not available for a good reason, just let the stock out of the spread portfolio for that period.

  • $\begingroup$ Hi, thanks for answering. I use STATA and I have cleaned the data and handled all missing data. I have 1 problem left with my Panel Data, it is unbalanced. Which means that not every firm has the same time period and some firms have broken time periods. I have for about 300.000 observations. I read somewhere that STATA can handle that and that I do not have to do anything. What shall I do with unbalaned panel data? $\endgroup$
    – user27532
    Apr 25, 2017 at 17:36
  • $\begingroup$ In practice, what researchers do is to roll forward some fundamental data from previous periods. Suppose that you don't have Size data for March, you may safely use February data, as the company's Size characteristic would not hugely change from one month to another! Note that this approach isn't safe for asset returns data! If for some reason you don't have data for a given stock, better excluding it from your cross-sectional estimation at this month. $\endgroup$ May 16, 2017 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.