![The Data Hall](/img/default-banner.jpg)
- Видео 182
- Просмотров 422 637
The Data Hall
Пакистан
Добавлен 13 июн 2019
Numbers are hard to interpret specially if they are not presented well.
Portfolio Sorting in R | Univariate portfolio sorting
There are different methods of portfolio sorting such as univariate portfolio soring, bivariate portfolio sorting, bivariate independent, and bivariate dependent portfolio sorting. In this video we only discuss how to perform univariate portfolio sorting in R. We construct the SMB and HML factor. There are three different methods that are discussed in this video i.e. dividing stocks on the basis of median, using xtile function and quantile function.
Download sample and code:
payhip.com/b/Xqbyg
Website: thedatahall.com
As an Amazon Associate, I earn from qualifying purchases.
Download sample and code:
payhip.com/b/Xqbyg
Website: thedatahall.com
As an Amazon Associate, I earn from qualifying purchases.
Просмотров: 68
Видео
Fama Macbeth Regression in R
Просмотров 138Месяц назад
In this video we explain how to perform fama and macbeth regression in R. There are three steps involved in fama macbeth regression. Firstly, we perform Time Series Regression (N Time series Regression), then we Perform Cross-sectional Regression (T cross-sectional regression) and lastly we take the time series average of these coefficients. Download the code and sample data: payhip.com/b/uqxcH...
How to Perform Rolling Regression in R
Просмотров 1202 месяца назад
In this video we discuss how to estimate beta using rolling regression I..e to perform rolling regression in R. We have used two packages i.e. the broom package and the slider package. The broom package have a function called rollapply and the slider package have different functions but the one we used is slider_period. Download do and exercise file: payhip.com/b/xD4ck Website: thedatahall.com ...
Calculate Weekly, Monthly, Yearly Stock Beta in R
Просмотров 312 месяца назад
In this video we discuss how to calculate stock return, excess stock return, excess market return and estimate beta using CAPM model. We discuss how to calculate weekly, monthly or yearly stock beta in R. In next video we will discuss how to calculate rolling beta in R. Download sample data and code: payhip.com/b/YTWuQ Website: thedatahall.com As an Amazon Associate, I earn from qualifying purc...
Calculate Portfolio Return in R
Просмотров 382 месяца назад
In our previous video we discussed how to download stock prices data using qountmod package and then we calculated weekly, monthly, yearly stock return using xts, tidyverse and tidyquant package. In this video we are going to discuss how to calculate portfolio return using xts package, tidyverse package and tidyquant package. Download code and sample data payhip.com/b/3HeVD 00:00 Load the data ...
Calculate Daily, Weekly, Monthly Stock Return in R
Просмотров 852 месяца назад
To perform an analysis on stock return, we first need to calculate it. In this video we are going to calculate daily, weekly, and monthly stock returns in R. We use quantmod package to download the stock prices and then calculate stock return using xts, tidyverse and tidyquant package. Download sample file and data payhip.com/b/43jDM 00:00 Download data from yahoo 4:12 Load stock prices from cs...
Download Cryptocurrency Data from Cryptocompare Using API
Просмотров 492 месяца назад
You can download cryptocurrency blockchain data or historical cryptocurrency data from cryptocompare.com using an API key. We can also download data from intotheblock.com, coinmarketcap.com, coinbase.com. Download the code: payhip.com/b/R48nO Website: thedatahall.com As an Amazon Associate, I earn from qualifying purchases.
Download Financial Data in R
Просмотров 432 месяца назад
To work with financial data we first need to download it. There is a package called quantmod that can be used to download financial data in R. Download the code: payhip.com/b/Ap7h4 Website: thedatahall.com As an Amazon Associate, I earn from qualifying purchases.
Systematic and Unsystematic risk (idiosyncratic risk) in Stata
Просмотров 852 месяца назад
In this video, we discuss how to estimate systematic and unsystematic risk i.e. idiosyncratic risk in Stata. Facebook : thedatahall/ Download exercise files: payhip.com/b/dZGmA How to Estimate Beta Using DCAPM (Downside CAPM) in Stata ruclips.net/video/GMblJumx2YU/видео.html Estimate Rolling Beta in Stata | Rolling Vs Asreg command ruclips.net/video/YdpVfrrGyjs/видео.html How to es...
Fama and French Five Factor Model in Stata
Просмотров 1942 месяца назад
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: payhip.com/b/iEhUl Website: thedatahall.com As an Amazon Associate, I e...
Three Way Interaction in R | The Data Hall
Просмотров 602 месяца назад
Three way interaction is when we have two moderating variables moderating the relationship between an independent and a dependent variable. In this video, we discuss what if some of the variables are categorical and if all the variables are continuous how would be perform the three-way interaction, estimate margins, and margins plot. Download exercise file: payhip.com/b/6oAeE Three way interact...
Fill Gaps in Time Series and Panel Data in R
Просмотров 582 месяца назад
When we work with time series or panel data in R , there are some missing value or gaps in the data. This video discusses how to to deal with these gaps. Excercise file: payhip.com/b/E5MHp Fill gaps in Time series and panel data thedatahall.com/filling-gaps-in-time-series-and-panel-data-using-r/ 00:000 Intro to video 0:27 Time series gaps 2:56 Panel data gaps Website: thedatahall.com As an Amaz...
Working With Missing Values in R
Просмотров 232 месяца назад
In this video we discuss explicit and implicit missing values. Excercise file: payhip.com/b/gVCJO Working with missing values in R thedatahall.com/dealing-with-missing-values-in-r/ 00:00 Intro to Topic 0:28 Explicit missing values 4:57 Implicit missing values Website: thedatahall.com As an Amazon Associate, I earn from qualifying purchases.
Generate Sample Data in R
Просмотров 162 месяца назад
We need sample data to work with some tasks in R, we can generate sample data using different methods. 00::00 Manually Generate Values 0:41 Normal Distribution Data 1:56 Categorical sample data 2:25 Categorical and Continuous Sample data Website: thedatahall.com As an Amazon Associate, I earn from qualifying purchases.
Download Stock Data in R
Просмотров 572 месяца назад
In this video we discuss how to download stock data in R. We use quantmod package and we use the getSymbols function. Website: thedatahall.com As an Amazon Associate, I earn from qualifying purchases.
Categorical and Continious Varialbe in Regression Using R Part3
Просмотров 332 месяца назад
Categorical and Continious Varialbe in Regression Using R Part3
Categorical Variable Regression in R Part2
Просмотров 333 месяца назад
Categorical Variable Regression in R Part2
Categorical Variable Regression in R | Part1
Просмотров 303 месяца назад
Categorical Variable Regression in R | Part1
Standardization and Normalization in Stata
Просмотров 4013 месяца назад
Standardization and Normalization in Stata
Standardization and Normalization in R
Просмотров 403 месяца назад
Standardization and Normalization in R
Working With Factors in R | Convert Categorical Variable into Factors
Просмотров 743 месяца назад
Working With Factors in R | Convert Categorical Variable into Factors
How to Perform ANOVA in R| One-Way and Two-Way ANOVA
Просмотров 133 месяца назад
How to Perform ANOVA in R| One-Way and Two-Way ANOVA
How to Perform ANOVA in Stata | One-Way and Two-Way ANOVA
Просмотров 3413 месяца назад
How to Perform ANOVA in Stata | One-Way and Two-Way ANOVA
Extract Data From a String in R | Working with String Part3
Просмотров 253 месяца назад
Extract Data From a String in R | Working with String Part3
Combining String Variable in R | Working With String Part 2
Просмотров 63 месяца назад
Combining String Variable in R | Working With String Part 2
Creating String in R | Working with String in R Part 1
Просмотров 273 месяца назад
Creating String in R | Working with String in R Part 1
Max VS Pmax | Maxium VS Parallel Maxium in R
Просмотров 153 месяца назад
Max VS Pmax | Maxium VS Parallel Maxium in R
Thank you so much. This was really helpful. Do you have a video about desctable?
No we don't. Will keep that in todo list
Couldn’t thank you enough for this wonderful video on stata. This video saved my day 😊
Welcome. Keep sharing
Thanks for the video. It went straight to the point. You saved lots of time while cleansing my dataset. Awesome video!
Welcome. Please keep sharing
very informative and helpful video lecture. I have query that there are 20 companies in my sample whose stock split occurred in a specific year e.g., 2020, but their stock split happened on different dates in that year. in this case how indexlist (BSE Sensex) data will be stagged.
Very nice explanation
Thanks. Keep sharing
it would be better if you share the do file of fama french 5 factor model as the file showing the panel data analysis in R
Please email me at info@thedatahall.com
sir can you please tell me how to change the stars and significance level for the correlation matrix, like if I want only 10, 5 and 1 % sig level?
You are a great explainer thank you
Thanks. Keep sharing
Is there a way I could overlay one graph over another in Stata?
U can do line graphs, like one line over another
great video ..thank you for explaining it so lucidly. i am running an event study to check the impact of CEO change on stock prices. i have put everything according to your format but on running the command i am getting the following error- "variable date does not uniquely identify observations in the using data." how this error can be rectified. Please help
Can we include both regression and panel regression in the same output table in stata?
Yes u can
@@thedatahall can you show it?
Search for outreg2 command on my channel. There is already a video explaining the process
I need to store the estimates of various model and show in the horizontal row while dependent variable needs to show in the column. Can it be done?
It's really hard to find a word to show my appreciation. Great explanation and insightful. Thank you!
Thanks. Keep sharing
This was helpful - thank you!
Keep sharing
Thanks for the video. I was wondering how you should interpret the final coefficients you obtain after running both stages? Do the coefficients represent risk premia? or rather the effect on returns?
Thank you for your teaching videos. They are very helpful. I was wondering if you have a video on how to combined more than one observations into one single observation in stata. To be clear, let us assume this scenario on disability types: 1- Difficulty in seeing : Yes = 1, No = 0 2- Difficulty in walking : Yes = 1, No = 0 3- Difficulty in speaking: Yes = 1, No = 0 4- Difficulty in hearing : Yes = 1, No = 0 Then we want to combine all these 4 observations into one single observation. This single observation can be named Persons with disability ( Yes: 1, No:0), Any guidance will be appreciated.
Check this link m.ruclips.net/video/pMHXTNVVNnU/видео.html
after concluding that we have time and entity fixed effect in the model, I test Autocorrelation and heteroscedasticity both exist in FEM, what should I do next, please replyyyyyyy
Could not have asked for a more comprehensive video. Thanks a lot
Welcome. Keep sharing
@@thedatahall Sure. Can i contact you i needed some help?
Is there a way we can report t stat in a different row using asdoc? Or we need to use outreg for that?
super informative, thank you sir, I was confused why I can't see my command history, turns out I need to save it in log/do file :"
Welcome
Really good and thorough explanation. Easy to follow
Thanks
You are so brilliant and your effort is great thank you
Thanks. Keep sharing
Thanks for the video! It's really clear and helpful. However, I have a different situation and I'm struggling to use margins command correctly. In my case, the independent variable is a dummy (0/1) and the moderator is a continuous variable. Can you tell me which command I should use to perform margins for this two-way interaction? Thank you in advance.
If you group_by the stock, would that prevent you from needing to run it in a loop? Or would these not recognize the grouping?
I am new in working with R, so you might correct me but I was not able to get it working by grouping for stocks. Maybe @The Data Hall can demonstrate how to use rolling regression on more then 1 company with multiple Facots like HML, SMB and Mkt-Rf on a month base.
@frankmeier7595 you can email me your data and code i will look into it
Can you please make an example for daily prices? I have daily data downloaded from Refinitiv so I don’t have that same variables and it is confusing how to create the spreadsheet to upload to stata and also the code part with fiscal year is difficult to understand having daily prices. Thanks
Can you please send me the data at info@thedatahall.com i will look into it and guide you
@@thedatahall Thank you! I now sent the email with the data set
I still cant understand how to calculate CAR, CAAR :(( where can I find how to do these on excel
There r tons of videos on doing event study in excel
Sir please provide the data set for practice purpose
Thanks for identifying. I have added it in the description.
can you share the complete code?
Thanks for identifying. I have added it in the description.
Thank you very much for your explanation. You've helpeme me doing my thesis
Thanks for the kind words. Please share our videos among your academic circle
Thanks a lot for the explanation
Thanks
Great thanks! It is very informative❤
Thanks
Thanks for this tutorial.
Welcome
Excellent explanations. Great work. Thank you so much for your clear explanations.
Thanks
Good job. It is very helpful
Thanks
I was wondering if its possible to use this method to analyse the risk premium for a specific risk factor through time, and see if there is a signficant risk premium present in specific time periods. Is there a way to do this?
Theoretically we can use this technique but i have to look at some paper that might have done this kind of analysis. If you have paper of this kind please share
I get the error "too many filenames" when running the local files : dir.. line. I have 11,000 files to combine. Any idea how to get over this error?
Thats the first time I came across this issue. Can u email me ur code and few files i will look into this (info@thedatahall.com)
Great video! Could you also show how to calculate the standard deviation of the value-weighted portfolios?
Thank you for the video. It is very helpful!
Is there has the part 2 of the video currently?
Thanks. Yes the 2nd and 3rd part discusses how to perform FF model in Stata and R. Please search fama and french in stata.
Very well explained! Thank you for saving my time :)
Thanks
Super helpful thanks!
Thanks
Can I use this code to calculate the CAR or BHAR an then to analyze the over-or underperformance of IPOs in comparison to a market index? I am not quite sure since there is obviously no data pre IPO.
You can do car and bhar but i am sure how you would do it in case of ipo's. The best source would be past papers related to event studies on ipo.
Always very helpful videos on Stata. Thanks for your time and efforts, and instead generosity.
Thanks for the kind words.
Great video, I was just wondering how you could alter the code to use Logit regressions instead?
You can try with statsby command, asreg will not work in this case.
great video. how would one incorporate fixed effects?
Hello, thank you for your video! It is very helpful and informative. You are a real lifesaver 😅 I have a question regarding CARs, Is there a formula how can I check CARs’ t-test significance (139 deals) because I get the data for CAAR (p-value) and AAR(p-value), but not for the CARs
Thanks for the kind words. The car values are in the crossfile.dta
@@thedatahall How about t-tests and p-values of those invidual CARs?
For these you will have to execute the eventstudy2 command separately for each event
Your videos are awesome. Thank you for uploading them. Can you please make a video on regression discontinuity design and instrumental variables?
Thanks for appreciation. Sure will keep this topic in my to do list
@@thedatahall Thank you😀
Hi. Thanks for the video. I want to run bivariate logistic reg with factor variable such educational or income levels for each year. May you please tell me how this type of loop would work work? Thanks
U can use bys year: logistics etc etc . U may not need loop
Thanks for quick reply l. have twenty years/countries. It looks more handy to use loops than bys years to draw coefficient plots of bivariate and multivariate models
Hi. Thanks for the video. I want to run bivariate logistic reg with factor variable such educational or income levels for each year. May you please tell me how this type of loops would work work? Thanks
Hello, great thanks for the video. It is a life saver for me in completing my thesis of event study. However, I encountered a problem as my M&A deals event date are spanning in 15 year with a total of 350 companies worldwide. I intend to use S&P 500 as market index (single factor model) with a separate estimation window for each acquirer of -150 days before event date (each acquirer has its own event date). In this case, my factors.dta instead of having one unique date for market returns for all, there are 350 different date spanning for each acquirer. In this case, how should i conduct forward with your coding? Furthermore, I would love to continue a cross-sectional analysis with CARs from event study by adding firm-level, industry-level and deal characteristics. Would be proactive to set up the code or data in advance along the event study? Thanks so much and I sincerely looking forward to your guidance!
Thanks. With regards to the different event and estimation window, the code take care of this automatically. I couldn't understand the next question. May be you can email me along with some research paper or material and i can guide you.
@thedatahall Great explanation! I used the statsby command and I got the coefficients of the factors in the end but I wanted to know how can I obtain the r-squared or the adjusted r-squared in this first approach. Is it possible in the statsby approach or only in the other methods (asreg, xtfmb, etc)?
Try this command statsby _b _se e(r2), by(foreign): regress mpg gear turn
Hello, My data has 250 companies and the stock return of each company is in each column making it a separate variable, what could be the function used? Plus I would want to save the value of the residuals too. How can I do that?
Check the reshape command
Very well explained, thank you!
Welcome