Fama and French Five Factor Model in Stata
8K views
May 16, 2024
In this video, we discuss how to perform fama and french five-factor model in Stata. We have demonstrated/designed the code using CRSP and Compustat database. However, you can modify the code for other markets. This do file contains comments that will help you understand each line of code. Download the code and dummy files: https://payhip.com/b/iEhUl Website: thedatahall.com As an Amazon Associate, I earn from qualifying purchases.
View Video Transcript
0:00
Welcome to the Data Hall YouTube channel
0:02
In this video we are going to discuss how to estimate Farman French 5 factor model in Stata
0:08
In one of my videos I have discussed working with Farman French 3 factor model and there
0:13
were requests that we should have a code related to Farman French 5 factor models
0:18
What I have done is I have developed this Farman French 5 factor model code in Stata
0:23
and for this demonstration purposes I am using the CRSP and ComputeStat data and what I am
0:30
doing is we have designed different sections within this do file. Each section would contain detailed comments for example we clean the stock identification
0:42
information, we clean the delisting information, we clean the monthly stock return data, then
0:47
we work with adjusting the returns for the delisted stock return, calculate access stock
0:53
return, clean the ComputeStat data, merge the CRSP and ComputeStat data using this link
0:59
table, CRSP link table. We calculate the size sorting, the market cap for size sorting, book to market ratio
1:08
operating profit and investment ratio. We do the portfolio sorting for all of these different portfolios that we have in Farman
1:18
French 5 factor model and lastly what I am going to do is I am going to download the
1:22
Farman French 5 factor returns, the 5 factor series from the Kenneth Farmer website and
1:30
I am going to show you that how close the factors that I have created are with the one
1:37
that are on the Kenneth Farmer website. So I am going to show you, I am going to test the accuracy of the 5 factor that I have created
1:45
So you can download this do file and the dummy data that you can use with this do file to
1:52
learn how to code, how to work with Farman French 5 factor model
1:56
Remember the data I have provided is not the data that I have provided in the download
2:03
link given in the description is not the CRSP and ComputeStat because I cannot provide that
2:09
data the CRSP and ComputeStat data due to copyright issues. So I have given you a dummy data set so you can execute this code, learn this code and
2:19
apply it on your own data set. Now it might be CRSP and ComputeStat data or you might work with certain other databases
2:27
or other markets and that's fine. Once you execute, once you learn this code and there are a lot of comments that walk
2:38
you through each line of code so there are more comments than there are code in this
2:43
do file and once you learn it you can modify this do file or let us know to modify it for you
2:50
So let me just give you an idea. So in this first section where we clean the stock identification information I have given
2:57
you the details of each line of code what that line of code would do, what each variable
3:04
that is in this file would mean and let me just give you one more example of this delisting
3:11
stock return. We adjust our stock return for the delisted information. So I have given you exact information
3:20
I have also given the references that you might need for our adjustments that we have done
3:30
So there are a lot of information within this do file. If you want to download it you can download it from the link given in the description
3:37
What I am going to do is I am going to execute this data, this do file and pause this video
3:44
for a while once I reach at this point where I am going to compare the series that I have
3:52
created with the one that is available on the Kenneth Farmer website
3:57
So let me pause, let me execute this and it is going to take a while maybe around three
4:06
to four minutes and I am going to pause this video for a while
4:11
Okay so the code had been executed. Let's combine all this data set
4:19
I have renamed this my SMB, my HML are the factors that I have created
4:25
Let's merge this with the data that I have downloaded from the Kenneth French website
4:33
and let me regress and find the correlation. So you can see the CMA that I have created have a 97.97 correlation with the CMA that
4:49
we have downloaded from the Kenneth Farmer website. Similarly there is 97.97 correlation so it is a high correlation between HML, SMB
5:05
Similarly you can look at the regression R square so this is 95% variation in my CMA
5:12
is explained by the variation in the CMA that I have downloaded
5:16
So this is quite close to the SMB and HML factors that we have downloaded from the Kenneth
5:22
Farmer website. So if you want to download this code and the dummy data that comes along with it for practice
5:29
purposes you can download that from the link given in the description
5:33
Do subscribe to this channel, do hit the bell icon and thanks for watching this video
#Business & Industrial
#Finance