The Data Hall
The Data Hall
  • Видео 182
  • Просмотров 422 637
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.
Просмотров: 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
Two-way interaction Using R Part4
Просмотров 163 месяца назад
Two-way interaction Using R Part4
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
Margins and Margins Plot in Stata
Просмотров 2653 месяца назад
Margins and Margins Plot in Stata
Standardization and Normalization in R
Просмотров 403 месяца назад
Standardization and Normalization in R
Working with Dates in R
Просмотров 393 месяца назад
Working with Dates 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

Комментарии

  • @sovannearyhuot4962
    @sovannearyhuot4962 6 часов назад

    Thank you so much. This was really helpful. Do you have a video about desctable?

    • @thedatahall
      @thedatahall 43 минуты назад

      No we don't. Will keep that in todo list

  • @tahminaferdous2291
    @tahminaferdous2291 2 дня назад

    Couldn’t thank you enough for this wonderful video on stata. This video saved my day 😊

  • @victorgallegos-rejas6238
    @victorgallegos-rejas6238 6 дней назад

    Thanks for the video. It went straight to the point. You saved lots of time while cleansing my dataset. Awesome video!

    • @thedatahall
      @thedatahall 6 дней назад

      Welcome. Please keep sharing

  • @DrSunilKumar-k2w
    @DrSunilKumar-k2w 7 дней назад

    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.

  • @tanushreedash5139
    @tanushreedash5139 9 дней назад

    Very nice explanation

  • @sauravmedhi1407
    @sauravmedhi1407 14 дней назад

    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

    • @thedatahall
      @thedatahall 14 дней назад

      Please email me at info@thedatahall.com

  • @bhuyashitalukdar2685
    @bhuyashitalukdar2685 15 дней назад

    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?

  • @Lily-cl6zk
    @Lily-cl6zk 17 дней назад

    You are a great explainer thank you

  • @KrishnenduJ-hc5fg
    @KrishnenduJ-hc5fg 20 дней назад

    Is there a way I could overlay one graph over another in Stata?

    • @thedatahall
      @thedatahall 20 дней назад

      U can do line graphs, like one line over another

  • @MOHDZAID-pj7hi
    @MOHDZAID-pj7hi 25 дней назад

    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

  • @debanjandas7006
    @debanjandas7006 26 дней назад

    Can we include both regression and panel regression in the same output table in stata?

    • @thedatahall
      @thedatahall 25 дней назад

      Yes u can

    • @debanjandas7006
      @debanjandas7006 25 дней назад

      @@thedatahall can you show it?

    • @thedatahall
      @thedatahall 25 дней назад

      Search for outreg2 command on my channel. There is already a video explaining the process

    • @debanjandas7006
      @debanjandas7006 24 дня назад

      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?

  • @najmehmoradi5122
    @najmehmoradi5122 27 дней назад

    It's really hard to find a word to show my appreciation. Great explanation and insightful. Thank you!

  • @adriennesmith3654
    @adriennesmith3654 Месяц назад

    This was helpful - thank you!

  • @MiguelVanEs
    @MiguelVanEs Месяц назад

    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?

  • @kwizeralambert1316
    @kwizeralambert1316 Месяц назад

    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.

    • @thedatahall
      @thedatahall Месяц назад

      Check this link m.ruclips.net/video/pMHXTNVVNnU/видео.html

  • @Vyquach0
    @Vyquach0 Месяц назад

    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

  • @bhuyashitalukdar2685
    @bhuyashitalukdar2685 Месяц назад

    Could not have asked for a more comprehensive video. Thanks a lot

    • @thedatahall
      @thedatahall Месяц назад

      Welcome. Keep sharing

    • @bhuyashitalukdar2685
      @bhuyashitalukdar2685 Месяц назад

      @@thedatahall Sure. Can i contact you i needed some help?

    • @bhuyashitalukdar2685
      @bhuyashitalukdar2685 Месяц назад

      Is there a way we can report t stat in a different row using asdoc? Or we need to use outreg for that?

  • @HelloThere-lo3qi
    @HelloThere-lo3qi Месяц назад

    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 :"

  • @NicklasAndersenBL
    @NicklasAndersenBL Месяц назад

    Really good and thorough explanation. Easy to follow

  • @usamaahmed6056
    @usamaahmed6056 Месяц назад

    You are so brilliant and your effort is great thank you

  • @mariadelpilarriverafranco6429
    @mariadelpilarriverafranco6429 Месяц назад

    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.

  • @stephenhilton2255
    @stephenhilton2255 Месяц назад

    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?

    • @frankmeier7595
      @frankmeier7595 Месяц назад

      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.

    • @thedatahall
      @thedatahall Месяц назад

      @frankmeier7595 you can email me your data and code i will look into it

  • @viisoreanuoana79
    @viisoreanuoana79 Месяц назад

    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

    • @thedatahall
      @thedatahall Месяц назад

      Can you please send me the data at info@thedatahall.com i will look into it and guide you

    • @viisoreanuoana79
      @viisoreanuoana79 Месяц назад

      @@thedatahall Thank you! I now sent the email with the data set

  • @Khanh_00
    @Khanh_00 Месяц назад

    I still cant understand how to calculate CAR, CAAR :(( where can I find how to do these on excel

    • @thedatahall
      @thedatahall Месяц назад

      There r tons of videos on doing event study in excel

  • @Kuntal20052011
    @Kuntal20052011 Месяц назад

    Sir please provide the data set for practice purpose

    • @thedatahall
      @thedatahall Месяц назад

      Thanks for identifying. I have added it in the description.

  • @frankmeier7595
    @frankmeier7595 Месяц назад

    can you share the complete code?

    • @thedatahall
      @thedatahall Месяц назад

      Thanks for identifying. I have added it in the description.

  • @nikolasandikaharyo9826
    @nikolasandikaharyo9826 2 месяца назад

    Thank you very much for your explanation. You've helpeme me doing my thesis

    • @thedatahall
      @thedatahall 2 месяца назад

      Thanks for the kind words. Please share our videos among your academic circle

  • @edwinsaavedra9518
    @edwinsaavedra9518 2 месяца назад

    Thanks a lot for the explanation

  • @DB-kv3wu
    @DB-kv3wu 2 месяца назад

    Great thanks! It is very informative❤

  • @carolineogbonne2360
    @carolineogbonne2360 2 месяца назад

    Thanks for this tutorial.

  • @jagathrohan-kr4nl
    @jagathrohan-kr4nl 2 месяца назад

    Excellent explanations. Great work. Thank you so much for your clear explanations.

  • @Asadkhan-xt8gs
    @Asadkhan-xt8gs 2 месяца назад

    Good job. It is very helpful

  • @arsec42
    @arsec42 2 месяца назад

    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?

    • @thedatahall
      @thedatahall 2 месяца назад

      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

  • @naynay7495
    @naynay7495 2 месяца назад

    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?

    • @thedatahall
      @thedatahall 2 месяца назад

      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)

  • @masintalanana2390
    @masintalanana2390 2 месяца назад

    Great video! Could you also show how to calculate the standard deviation of the value-weighted portfolios?

  • @wantinggan8960
    @wantinggan8960 2 месяца назад

    Thank you for the video. It is very helpful!

    • @wantinggan8960
      @wantinggan8960 2 месяца назад

      Is there has the part 2 of the video currently?

    • @thedatahall
      @thedatahall 2 месяца назад

      Thanks. Yes the 2nd and 3rd part discusses how to perform FF model in Stata and R. Please search fama and french in stata.

  • @anlanhnguyen-ly9vi
    @anlanhnguyen-ly9vi 2 месяца назад

    Very well explained! Thank you for saving my time :)

  • @zori4877
    @zori4877 2 месяца назад

    Super helpful thanks!

  • @MrTobisonson
    @MrTobisonson 3 месяца назад

    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.

    • @thedatahall
      @thedatahall 3 месяца назад

      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.

  • @naimatkadha817
    @naimatkadha817 3 месяца назад

    Always very helpful videos on Stata. Thanks for your time and efforts, and instead generosity.

    • @thedatahall
      @thedatahall 3 месяца назад

      Thanks for the kind words.

  • @flynndavies3544
    @flynndavies3544 3 месяца назад

    Great video, I was just wondering how you could alter the code to use Logit regressions instead?

    • @thedatahall
      @thedatahall 3 месяца назад

      You can try with statsby command, asreg will not work in this case.

  • @petermcadam8415
    @petermcadam8415 3 месяца назад

    great video. how would one incorporate fixed effects?

  • @ariunajou2318
    @ariunajou2318 3 месяца назад

    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

    • @thedatahall
      @thedatahall 3 месяца назад

      Thanks for the kind words. The car values are in the crossfile.dta

    • @LeoFIN3
      @LeoFIN3 3 месяца назад

      @@thedatahall How about t-tests and p-values of those invidual CARs?

    • @thedatahall
      @thedatahall 3 месяца назад

      For these you will have to execute the eventstudy2 command separately for each event

  • @shwetaagarwal6240
    @shwetaagarwal6240 3 месяца назад

    Your videos are awesome. Thank you for uploading them. Can you please make a video on regression discontinuity design and instrumental variables?

    • @thedatahall
      @thedatahall 3 месяца назад

      Thanks for appreciation. Sure will keep this topic in my to do list

    • @shwetaagarwal6240
      @shwetaagarwal6240 3 месяца назад

      @@thedatahall Thank you😀

  • @BilalHassan-zv8wh
    @BilalHassan-zv8wh 3 месяца назад

    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

    • @thedatahall
      @thedatahall 3 месяца назад

      U can use bys year: logistics etc etc . U may not need loop

    • @BilalHassan-zv8wh
      @BilalHassan-zv8wh 3 месяца назад

      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

  • @BilalHassan-zv8wh
    @BilalHassan-zv8wh 3 месяца назад

    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

  • @lingcao1301
    @lingcao1301 3 месяца назад

    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!

    • @thedatahall
      @thedatahall 3 месяца назад

      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.

  • @rodrigomota3369
    @rodrigomota3369 3 месяца назад

    @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)?

    • @thedatahall
      @thedatahall 3 месяца назад

      Try this command statsby _b _se e(r2), by(foreign): regress mpg gear turn

  • @bhagyabhutani7752
    @bhagyabhutani7752 3 месяца назад

    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?

    • @thedatahall
      @thedatahall 3 месяца назад

      Check the reshape command

  • @Lucenne
    @Lucenne 3 месяца назад

    Very well explained, thank you!