2
$\begingroup$

I would like to work with hourly recorded data. I would like to convert it to daily data. I am thinking of taking the mean of each day. However, I am not sure if this is correct or no?

Any help, please?

$\endgroup$
6
  • 4
    $\begingroup$ Yes you can do that. However, in aggregating the data you may lose some important patterns, this may or may not be important for your task. $\endgroup$ Jul 31, 2019 at 12:45
  • 2
    $\begingroup$ Wouldn't it be the sum of what happens in each 1-hour period that gives you the daily value? $\endgroup$
    – Dave
    Jul 31, 2019 at 13:15
  • $\begingroup$ @Dave Or sorry, I think I should take the sum of the day to give me the value of the day. $\endgroup$
    – Mary
    Jul 31, 2019 at 13:54
  • 1
    $\begingroup$ @Mary I really have no idea what alternative you have to adding up the hourly values to find the daily values. It would be like finding your restaurant bill a way other than adding up the prices of each dish (okay, there's tax and tip, but you get the idea). Do you have another idea in mind? $\endgroup$
    – Dave
    Jul 31, 2019 at 14:53
  • $\begingroup$ @Dave Thank you so much for your nice and helpful comments. In statistic, we usually take the mean of the hourly data to get the daily value. I even remember (a long time ago) my supervisor said that to me. But I never work with such data before. $\endgroup$
    – Mary
    Aug 1, 2019 at 6:50

2 Answers 2

1
$\begingroup$

You can do that, calling it as a smoothing (moving average) process (please, don't confuse this meaning of moving average with the one related, for example, to ARMA process).

It worth noting that if you have 240 hourly data, this process give you only 10 daily data points. Are they enought? Good. If not, there is another way. Depending on your task, you could preserve the initial number of observation in your sample by using a rolling window to average:

  • take the mean of the first 24 observations (1st to 24th), which is the first daily data point;
  • take the mean of the "second" 24 observations (not from 25th to 48th, but from the 2nd to 25th) to obtain the second data point;
  • and so on...
$\endgroup$
4
  • $\begingroup$ Thank you for your answer. But I really do not get the second point. Why do you think, for the second 24 observations, I should start from the $2^{nd}$ observation instead of the $25^{th}$? $\endgroup$
    – Mary
    Aug 1, 2019 at 6:57
  • $\begingroup$ Dear @Mary, from 1 pm of today to 1pm of Tomorrow there is one day. But also from 2 pm of today to 2 pm of Tomorrow there are 24 hours, one day. The same for 3 pm or 7 am and so on. If your is the case (and I don't know if it is!), you could obtain daily observation in this way. Make sense? $\endgroup$
    – Bert
    Aug 1, 2019 at 8:11
  • $\begingroup$ @Mary, by the way, since you have one year of hourly data (a large sample, even if I don't know what is your goal!), I think you can simply average each 24 data, as told you@IrishStat, obtaining however a sample big enough to, for example, forecasting few days ahed your last observation. But I have to undestand your goal to better advise you! $\endgroup$
    – Bert
    Aug 1, 2019 at 8:18
  • $\begingroup$ Thank you so much for your help. Apologise for the delay. My data is air pollution. I would like to fit a regression model to this data. $\endgroup$
    – Mary
    Aug 5, 2019 at 7:14
1
$\begingroup$

You can build a model at the hourly level and forecast the next N hours for the next K days

If there are hidden/latent anthropormorphic effects such as day-of-the-week effects , day-of-the-month effects they may be detectable. If there are deterministically significant seasonal effects i.e.monthly effects they may be detectable and used with assumptions. If there are level shifts or local time trends or anomalies they may be detectable.

Only your data knows for sure. You might search on SE https://stats.stackexchange.com/search?q=user%3A3382+hourly for more discussions about hourly data.

$\endgroup$
1
  • $\begingroup$ Thank you for your answer. However, my data is for one year. For example, air pollution (recorded hourly) for the year 2018! $\endgroup$
    – Mary
    Aug 1, 2019 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.