Announcement

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

  • Panel data analysis - how to aggregate from weekly to annual frequency?

    Dear Stata Specialists,

    I have a problem in aggregating the data from weekly yo yearly. I use tscollap command and it return me the following error: The target frequency must be lower than the current frequency.
    To be more specific this is a panel data, strongly balanced with a weekly time frequency for 20 countries between 2005w1 until 2014w52. Is there another method to collapse or aggregate from week to year and country specific data (i don't want to lose any of them - e.g. year and country)?. What I want to obtain is yearly data for each country aggregated from the initial weekly data.
    On the other hand, my first intention was to use an analysis which combines different sampling data or the famous MIDAS - Mixed Data Sampling regression, but to my limited skills I cannot find useful information in how to combine in the same panel data time series with different frequencies such as: weekly and yearly, therefore I have to use aggregation in order to estimate a linear regression. If there is a method to use MIDAS Regression in Stata please help me. Thank you for your time and attention.

    Best Regards, Marian
    Last edited by Marian Dobranschi; 20 Mar 2015, 05:47.

  • #2
    The documentation for the user-written command tscollap found in help tscollap suggests it is not able to collapse weekly data.
    tscollap is for use with time-series data of monthly, quarterly, or half-yearly frequency.
    The error message tscollap returned was misleading.

    Comment


    • #3
      I suspect that this raises a standard question about weeks in Stata. Outside Stata, there is usually a rule that weeks start on specified days of the week, or that weekly data are issued on, or refer to, a particular day of the week. Defined either way, it follows that weeks do not usually nest within any other time unit: the only exception possible is that sometimes the definition implies exactly four weeks in February.

      So, linking details: I imagine that this is the reason why tscollap (STB, SSC) does not support weeks.

      It does raise the question of how you can import your data into Stata at all except by ignoring any week 53 in the data or otherwise mangling them.

      That aside, a one-word answer is collapse

      I don't know anything about MIDAS regression. That question may get ignored unless you ask it separately.

      Comment

      Working...
      X