Announcement

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

  • How do I convert daily stock prices into weekly prices?

    Dear all,

    I'm currently doing a research on Google trends to investigate how internet searches are related to the trading activity, volatility and liquidity of the financial market. I want to investigate whether information from internet searches can improve volatility forecasting. Since this requires some programming skills and I'm fairly new with Stata, I'm reaching for help here and hope someone can give me a guided answer. I obviously need some data in order to conduct our analysis, so my first challenge is to convert daily stock prices into weekly price in such way that they would be aligned with the weekly google search data. I'm using 5-years historical daily prices, which I already have downloaded into an excel-file. I tried to use this guide: https://sites.google.com/site/imspes...ly-frequencies, but can't get the hang of it. Is there a way to do it in Stata?

    Your help is greatly appreciated!


  • #2
    (I'll upload the excel file I want to covert into weekly prices)
    Attached Files

    Comment


    • #3
      Please read and act on http://www.statalist.org/forums/help#stata 12.5

      You are asked not to post attachments that are in Word or Excel file formats (.doc, .docx, .xls, .xlsx), because
      • many members just don't have or don't use such software
      • obliging other members to open those programs to see your problem is at best awkward and indirect
      • many members have zero-risk policies on not opening such files from third parties
      • there are better ways to show the information, as explained just above.
      We should add:

      If you show us just a spreadsheet file, we have no way to be sure what names and variable types the data would have in Stata, or even sometimes whether the data could be read into Stata without a problem.

      Comment


      • #4
        Any way, what is a week? Does it start on Monday? Or what else is the definition?

        If this seems well known in your field, consider that by my best guess none (0) out of the 20 most active people who answer the most questions here work routinely with this kind of data.

        Comment


        • #5
          To expand on Nick's comments, If you have a week identifier created (that includes both year and week in year), then you can collapse your data by week. How you create a weekly date identifier depends on how you have your dates stored and how you define a week..

          As Nick suggested, please provide your Stata code (using code delimiters), Stata output, and sample data from Stata (using dataex). This will let us understand the structure of your data and make sure our suggested solutions work.

          Comment


          • #6
            You should also look at Nick's posting here:
            http://www.statalist.org/forums/foru...week-indicator

            Comment

            Working...
            X