Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating weighted average return of portfolio

    I have a question concerning the average return of a portfolio.

    I created 2 groups of stocks, one with sin stocks (alcohol, tobacco and gambling) and one with comperables.
    For all the individual firms I have their bid, ask, open price and volume on a daily basis from 1965-2018 (or the period they exist). I would like to generate weighted average monthly returns for the sin group and the comparable group. How can I generate this in Stata?

    I am replicating the paper: The price of sin: The effects of social norms on markets by Hong and Kacperczyk.




  • #2

    So far, I managed to create the monthly returns of each stock. But how do I create the weighted average return for group 1 and 2?


    Click image for larger version

Name:	snapshot stata.PNG
Views:	1
Size:	60.2 KB
ID:	1502070

    Comment


    • #3
      Weighted average weighted by what?

      Also, please read the Forum FAQ for excellent advice about how to get the most out of your Statalist posts. Among the things you will learn there, screenshots of example data are not very helpful. Most often they are unreadable (though yours can be read, at least on my setup). But even when they are readable, it is not possible to import the data from a screenshot into Stata, which few of those who might help you would be willing to do. To avoid putting obstacles in the path of the people who might respond to your question, use the -dataex- command to show example data. If you are running version 15.1 or a fully updated version 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

      You will also learn in the FAQ that incomplete references are also not very helpful. Maybe everybody in your circle knows that paper by Hong and Kaperczyk, but I assure you that many Forum members do not. In a situation like this one, it is best to give a good description of the methodology you are trying to emulate, or perhaps quote it from the methods section of the paper. If it is too lengthy or complicated for that, the next best thing is to provide a link to a non-paywalled version of the paper. If that is not possible, then provide a complete citation that would allow somebody unfamiliar with the paper to find it.
      Last edited by Clyde Schechter; 07 Jun 2019, 15:35.

      Comment


      • #4
        It might be helpful
        Code:
        ssc install asgen
        help asgen
        asgen finds weighted average mean. There are several examples in the help file on how to find the weighted average mean.
        Last edited by Attaullah Shah; 08 Jun 2019, 02:30.
        Regards
        --------------------------------------------------
        Attaullah Shah, PhD.
        Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
        FinTechProfessor.com
        https://asdocx.com
        Check out my asdoc program, which sends outputs to MS Word.
        For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

        Comment

        Working...
        X